#include <bits/stdc++.h>   using namespace std;   int main() {     int x;     cin >> x;     x = abs(x);     int pos = 0;     int i;     for (i = 1; pos < x; i++) pos += i;     int diff = pos - x;     if (diff % 2 == 0)       cout << (i - 1) << endl;     else {       if (i % 2 != 0)         cout << i << endl;       else         cout << i + 1 << endl;     }   }   