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