#include <bits/stdc++.h>
using namespace std;



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    long long n;
    cin >> n;
    long long p = sqrt(2 * n + 2);
    while ((p + 1) * p <= 2 * n + 2)
        p++;

    cout << n + 1 - p + 1;


    return 0;
}

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  ll n;
  cin >> n;

  ll ans = 2;
  for (ll l = 1; l <= 1e7; l++) {
    ll a = (2 * n - l * (l - 1));
    ll b = a / (2 * l);
    if (a % (2 * l) == 0 && b > 0 && b < n) {
      ans += 2;
    }
  }
  cout << ans << endl;

  return 0;
}
