L = int(input()) M = int(input()) N = int(input()) r = 0 if N > 25: r = N % 25 n = N //25 d,m = (M+n)//4,(M+n)%4 s,l = (L+m)//10,(L+m)%10 print(r+d+s+l)