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