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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define          pb                push_back
#define          eb                emplace_back
#define          endl              '\n'
#define          all(x)            x.begin(), x.end()
#define          sz(x)             int(x.size())
#define          pii               pair<int, int>
#define          pll               pair<ll, ll>
#define          ff                first
#define          ss                second

const ll INF = LLONG_MAX;
const int MOD = 1e9+7;
const int MX = 2e5+7;
const double PI = 3.1415926535897932384626;

template<class T> void dbg(T val) {
    cout << val << endl;
}

template<class T> void dbgs(T val) {
    cout << val << " ";
}

void solve() {
    ll N; cin >> N;
    ll x = 0;
    ll sum = 0;
    for (ll i = 1;;++i) {
        if (sum >= N) break;
        sum += i;
        x++;
    }
    dbg(x);
}

void fastIO(string name = "") {
    cin.tie(0)->sync_with_stdio(0);
    if (sz(name)) {
        freopen((name + ".in").c_str(), "r", stdin);
        freopen((name + ".out").c_str(), "w", stdout);
    }
}

int main() {
    fastIO("");

    int tc = 1; //cin >> tc;
    while (tc--) solve();
    return 0;
}
#include <iostream>
#include <cfenv>
#include <cmath>
using namespace std;

int main(){
    int N;
    int x;
    cin >> N;
    for(int i =0; i < N + 1; i++){
        x += i;
        if(x >= N ){
            cout << i << endl;
            break;
        }
    }
}