n = int(input()) a = n % 500 if a < 100: print(n//500) else: print(n//500 + 1)