L = int(input()) M = int(input()) N = int(input()) def div(a, b): c = a // b d = a % b return(c, d) n1, n2 = div(N, 25) m1, m2 = div(M+n1, 4) l1, l2 = div(L+m1, 10) print(n2+m2+l2)