#no.32 import math L = int(input()) M = int(input()) N = int(input()) M = M + math.floor(N/25) N = N%25 L = L + math.floor(M/4) M = M%4 L = L%10 print (L+M+N)