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