L = int(input()) M = int(input()) N = int(input()) while L >= 25: L = L - 25 M += 1 while M >= 4: M = M - 4 N += 1 while N >= 10: N = N - 10 print(L + M + N)