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