N = int(input()) A = N // 500 if(A * 500 + 100 > N): print(A) else: print(A+1)