L = input() #100 M = input() #25 N = input() #1 n = N//25 a = N%25 m = (n+M)//4 b = (n+M)%4 c = (m+L)%10 print(a+b+c)