# coding: UTF-8 import sys import os #FILES = os.listdir('./test') #for FILE in FILES: # fd = os.open('./test/' + FILE, os.O_RDONLY) # os.dup2(fd, sys.stdin.fileno()) #fd = os.open('file.txt', os.O_WRONLY|os.O_CREAT) #os.dup2(fd, sys.stdout.fileno()) fd = os.open('test.txt', os.O_RDONLY) os.dup2(fd, sys.stdin.fileno()) # “ü—Í import heapq from collections import deque d = deque() L = int(input()) M = int(input()) H = int(input()) h = H // 25 M += h m = M // 4 L += m l = L // 10 count = H - h * 25 + M - m * 4 + L - l * 10 print(count)