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