let n = stdin.ReadLine() |> int let n2 = n / 500 let n3 = n2 * 500 + 99 if n <= n3 then n2 else n2 + 1 |> printfn "%d"