l, m, n = [int(input()) for _ in range(3)] m += n//25 l += m//4 print(l%10 + m%4 + n%25)