l = int(input()) m = int(input()) n = int(input()) t = l*100+m*25+n*1 a = t % 1000 x = a//100 al = a % 100 y = al//25 z = al % 25 print(x+y+z)