#include #include #include using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(nullptr); int N, ans = 0; cin >> N; ans = N / 500; N %= 500; if (N < 100) { cout << ans << endl; } else { cout << ans + 1 << endl; } return 0; }