#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int tot = 0;
  cin >> a;
  if (a == 0) {
    cout << 0;
    return 0;
  }
  if (a < 0) a -= 2 * a;
  for (int i = 1, x = 1; x && !tot; ++i, x += i) {
    if (x == a || (x > a && !((x - a) % 2))) tot = i;
  }
  cout << tot;
  return 0;
}
