list = [] for i in range(3): list.append(int(input())) list[1] += list[2] / 25 list[2] = list[2] % 25 list[0] += list[1] / 4 list[1] = list[1] % 4 list[0] = list[0] % 10 print(int(sum(list)))