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