import sys input = sys.stdin.buffer.readline L = int(input()) M = int(input()) N = int(input()) S = 100 * L + 25 * M + 1 * N S = S % 1000 L2 = S // 100 S = S % 100 M2 = S // 25 S = S % 100 N2 = S print(L2 + M2 + N2)