L, M, N = map(int, input().split()) sum = L * 100 + M * 25 + N LL = sum // 1000 sum -= LL * 1000 L = sum // 100 sum -= L * 100 M = sum // 25 sum -= M * 25 print(LL + L + M * sum)