n = int(input()) che = divmod(n, 500) if che[1] < 100: print(che[0]) else: print(che[0] + 1)