a = int(input()) b = int(input()) c = int(input()) while c >= 25: b += 1 c -= 25 while b >= 4: a += 1 b -= 4 print(a+b+c)