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