#include #include #include #include using namespace std; using namespace atcoder; using ll = long long; using P = pair; using Graph = vector>; using WGraph = vector>>; using mint = modint998244353; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) mt19937_64 rng(58); long double PI = 3.14159265358979; const ll LLMAX = 9223372036854775807; const ll INF = 1e18; vector di = {1, 0, -1, 0}; vector dj = {0, -1, 0, 1}; void chmin(ll& x, ll y) { x = min(x, y);}; void chmax(ll& x, ll y) { x = max(x, y);}; int main() { ll n; cin >> n; ll ans = n / 500; ll rest = n % 500; if (rest >= 100) ans++; cout << ans << endl; return 0; }