#include using namespace std; typedef long long ll; typedef string str; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll n; cin >> n; if (n % 500 < 100) cout << n / 500; else cout << n / 500 + 1; return 0; }