//
// Created by Anton Gorokhov
//

#ifdef lolipop
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <cstddef>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <ctime>
#include <unordered_map>
#include <random>
#include <iomanip>
#include <cmath>
#include <queue>
#include <unordered_set>
#include <cassert>
#include <bitset>
#include <deque>
#include <utility>

#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define ld double

using namespace std;

mt19937 rnd(time(nullptr));

inline void fastio() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
}

void solve() {
    int n;
    cin >> n;
    int L = -1, R = n;
    while (L + 1 < R) {
        int M = (L + R) / 2;
        if ((M * (M + 1)) / 2 >= n) {
            R = M;
        } else {
            L = M;
        }
    }
    cout << R << '\n';
}

signed main() {
#ifdef lolipop
    freopen("input.txt", "r", stdin);
#else
    fastio();
#endif
    int T = 1;
//    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}
#include <stdio.h>

int N, Sum;

int main() {
	int i;

	scanf("%d", &N);
	for (i = 1; Sum < N; Sum += i, i++);

	printf("%d", i - 1);

	return 0;
}
