#include using namespace std; typedef long long ll; int main(){ ll n; cin >> n; ll l = 0; ll r = pow(10,9); while(1){ if(r - l <= 1)break; ll mid = (l + r) /2; if(mid*mid + mid >= n*2)r = mid; else l = mid; } cout << r << endl; }