#include using namespace std; int main(){ int N; cin >> N; int x = N /500; if(N%500 > 100){ cout << x+1 << endl; }else{ cout << x << endl; } }