#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <cstring>
#include <regex>
#include <cmath>
#include <algorithm>
#include <vector>
#include <list>
#include <map>
#include <unordered_set>
#include <queue>
#include <unordered_map>
#include <set>
#include <cassert>
#include <climits>
#include <bitset>
#include <numeric>

#pragma GCC optimize("O3")

using namespace std;
using ll = long long;
using ull = unsigned long long;
template<typename Key, typename Value>
using umap = std::unordered_map<Key, Value>;
template<typename Key>
using uset = std::unordered_set<Key>;

#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; ++i)
#define repd(i, n) for(ll i = (n) - 1ll; i >= 0; --i)
#define rep1(i, n) for(ll i = 1, i##_len = (n); i <= i##_len; ++i)
#define repd1(i, n) for(ll i = (n); i > 0; --i)
#define FOR(i, a, b) for(ll i = a; i < ll(b); ++i)
#define FORD(i, a, b) for(ll i = a; i > ll(b); --i)
#define foreach(i, itr) for(auto& i : (itr))
// 小さい順
#define asort(arr, size) std::sort((arr), (arr) + (size))
// 大きい順
#define dsort(arr, size) std::sort((arr), (arr) + (size), [](auto a, auto b) { return a > b; })
#define vsort(vec) std::sort((vec).begin(), (vec).end());
#define rsort(vec) std::sort((vec).begin(), (vec).end(), [](auto a, auto b) { return a > b; });
#define bit(n) (1LL << (n))

// 行数多く出力するとき用

inline void println(int n) {
    printf("%d\n", n);
}
inline void println(ll n) {
    printf("%lld\n", n);
}
inline void println(ull n) {
    printf("%llu\n", n);
}

inline void println(int* n, size_t size) {
    FOR(i, 0, size - 1) {
        printf("%d ", n[i]);
    }
    printf("%d\n", n[size - 1]);
}
inline void println(ll* n, size_t size) {
    FOR(i, 0, size - 1) {
        printf("%lld ", n[i]);
    }
    printf("%lld\n", n[size - 1]);
}
inline void println(ull* n, size_t size) {
    FOR(i, 0, size - 1) {
        printf("%llu ", n[i]);
    }
    printf("%llu\n", n[size - 1]);
}


////////////////////////////////////
////////////////////////////////////

int main() {
    ll N;
    cin >> N;
    ll n = 1;
    ll i = 1;
    while (n < N) {
        ++i;
        n += i;
    }

    cout << i << endl;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

const int MOD = 1000000007;
const int MAX32 = 2147483647;
const long long MAX64 = 9223372036854775807;
const double PI = 3.14159265358979323846;

int main() {
  long long n, i = 0;
  cin >> n;
  while (n > 0) {
    n -= ++i;
  }
  cout << i << endl;
}