t=0 for i in range(3): t += int(input())*[100,25,1][i] k,l = divmod(t,1000) l,m = divmod(l,100) m,n = divmod(m,25) print(l+m+n)