N = int(input()) ans = N // 500 if N % 500 >= 100: ans += 1 print(ans)