nof_100 = int(input().rstrip()) nof_25 = int(input().rstrip()) nof_1 = int(input().rstrip()) nof_25 += nof_1 // 25 nof_1 %= 25 nof_100 += nof_25 // 4 nof_25 %= 4 nof_100 %= 10 print(nof_1 + nof_25 + nof_100)