#include #include #include using namespace std; using ll = long long; int main(void){ int n; cin >> n; int t=n/500; if(t*500+100>n) cout << t << endl; else cout << t+1 << endl; return 0; }