N = int(input()) M = int(input()) L = int(input()) M += (L//25) N += (M//4) L = L%25 M = M%4 N = N%10 print(L+N+M)