Krishnan bought chocolates for his brothers. When he grouped the chocolates in groups of 4, 1 chocolate was left, if grouped in 5, 4 chocolates were left, if grouped in 6, 1 chocolate was left and if grouped in 7, no chocolate was left ungrouped. If the total number of chocolates bought was less than 50, find the number of chocolates Krishnan bought.