#include <bits/stdc++.h>
using namespace std;
long long sum(long long n) {
  int sum;
  sum = (n * (n + 1) / 2);
  return sum;
}
int main() {
  long long x, dif, sol;
  cin >> x;
  x = abs(x);
  sol = (long long)(((sqrt(1 + 8 * x)) - 1) / 2);
  if (sum(sol) != x) {
    sol = sol + 1;
    dif = (sum(sol)) - x;
    while (dif % 2 != 0) {
      sol = sol + 1;
      dif = sum(sol) - x;
    }
  }
  cout << sol << endl;
  return 0;
}
