L = int(input()) M = int(input()) N = int(input()) sum = L * 100 + M * 25 + N * 1 a = sum / 1000 b = (sum - a * 1000) / 100 c = (sum - a * 1000 - b * 100) / 25 d = sum - a * 1000 - b * 100 - c * 25 print(b + c + d)