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