import std; void main () { int N = readln.chomp.to!int; int ans = N / 500; N %= 500; if (100 <= N) { ans++; } writeln(ans); } void read (T...) (string S, ref T args) { import std.conv : to; import std.array : split; auto buf = S.split; foreach (i, ref arg; args) { arg = buf[i].to!(typeof(arg)); } }