c100 = int(input()) c25 = int(input()) c1 = int(input()) c25 += c1 // 25 c1 %= 25 c100 += c25 // 4 c25 %= 4 c100 %= 10 print(c1 + c25 + c100)