l = int(input()) m = int(input()) n = int(input()) s = (l * 100 + m * 25 + n) % 1000 lc = s // 100 mc = (s % 100) // 25 nc = s - lc*100 - mc*25 print(lc + mc + nc)