#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-10;
int main() {
  long long x;
  cin >> x;
  x = abs(x);
  long long num = 0;
  long long p = 0;
  while (true) {
    if (num >= x && (num - x) % 2 == 0) {
      cout << p << endl;
      break;
    }
    num += ++p;
  }
  return 0;
}
