L = input() M = input() N = 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)