l = int(input()) m = int(input()) n = int(input()) p = int(l/25) l -= 25*p m += p q = int(m/4) m -= 4*q n += q r = int(n/10) n -= 10*r print(l + m + n)