L = int(input()) M = int(input()) N = int(input()) s = L*100+M*25+N s %= 1000 ans = 0 ans += s//100 s %= 100 ans += s//25 s %= 25 ans += s print(ans)