#include <iostream>
#include <vector>
#include <cmath>
#include <stdio.h>
using namespace std;
void fast_io(){
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
}
int main()
{
fast_io();
long long Sn;
#ifdef ONLINE_JUDGE
cin >> Sn;
#endif
#ifndef ONLINE_JUDGE
Sn = 15;
#endif
// n^2 + n - 2Sn = 0
double n1 = (-1+sqrt(1-(4*1*-2*Sn)))/2;
double n2 = (-1-sqrt(1-(4*1*-2*Sn)))/2;
cout << floor(max(n1, n2));
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y21hdGg+CiNpbmNsdWRlIDxzdGRpby5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnZvaWQgZmFzdF9pbygpewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSksIGNpbi50aWUobnVsbHB0ciksIGNvdXQudGllKG51bGxwdHIpOwp9CgppbnQgbWFpbigpCnsKICAgIGZhc3RfaW8oKTsKICAgIGxvbmcgbG9uZyBTbjsKICAgICNpZmRlZiBPTkxJTkVfSlVER0UKICAgICAgICBjaW4gPj4gU247CiAgICAjZW5kaWYKICAgICNpZm5kZWYgT05MSU5FX0pVREdFCiAgICAgICAgU24gPSAxNTsKICAgICNlbmRpZgogICAgLy8gbl4yICsgbiAtIDJTbiA9IDAKICAgIGRvdWJsZSBuMSA9ICgtMStzcXJ0KDEtKDQqMSotMipTbikpKS8yOwogICAgZG91YmxlIG4yID0gKC0xLXNxcnQoMS0oNCoxKi0yKlNuKSkpLzI7CiAgICBjb3V0IDw8IGZsb29yKG1heChuMSwgbjIpKTsKfQo=