L = int(input()) M = int(input()) N = int(input()) m = N // 25 n = N-m l = M + m // 4 mm = M + m - l S = L + l //10 ll = L + l - S print(n+mm+ll)