L = int(input()) M = int(input()) N = int(input()) M += N//25 n = N%25 L += M//4 m = M%4 K = L//10 l = L%10 print(K+l+m+n)