n = int(input()) n -= 99 ans = n // 500 if n % 500 != 0: ans += 1 print(ans)