#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const* argv[]) {
  int x, res = 0;
  cin >> x;
  if (x < 0) x = -x;
  for (int i = 1, t = 1; x && !res; i++, t += i)
    if (t == x || (t > x && !((t - x) % 2))) res = i;
  cout << res;
  return 0;
}
