L = input() M = input() N = input() n = N//25 m = (N+n)//100 l = (L+m)//1000 print(L+M+N-n*25-m*4-l*10)