L = int(input()) M = int(input()) N = int(input()) sum = L*100 + M*25 + N R = sum%1000 c100 = R//100 R = R%100 c25 = R//25 c1 = R%25 c = c100 + c25 + c1 print(c)