728x90
#include <iostream>
#include <algorithm>
#include <string>
#include <deque>
#include<cstring>
#include<map>
using namespace std;
int main() {
long long s;
cin >> s;
long long answer = 0;
long long i = 1;
long long sum = 0;
while (sum <= s) {
if (sum == s) { cout << i - 1 << endl; return 0; }
sum += i;
i++;
}
answer = i - 2;
cout << answer<<endl;
}