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