#include<bits/stdc++.h>
using namespace std;
int main() {

    long long n;
    cin >> n;
    long long i = 1;
    while(n>0) {
        n -= i;
        i += 1;
    }
    cout<<i-1<<endl;
    return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,m,n) for (int i = (m); i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; --i)
#define RREP(i,m,n) for (int i = (n)-1; i >= (m); ++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int,int>;
const int INF = 1e9+7;

int main() {
  int n; cin >> n;

  int x = 1;
  while (x * (x+1) < 2 * n) {
    x++;
  }

  cout << x << endl;
}
