#include <bits/stdc++.h>
using namespace std;
int x;
int main() {
  cin >> x;
  int s = 0, next = 0, p;
  long long t = 0;
  if (x < 0) {
    x = -x;
  }
  if (x > 0) {
    for (int i = 0; next <= x; i++) {
      s = next;
      t = i;
      t *= i;
      t += i;
      t /= 2;
      next = t;
      if (x != s) {
        p = i;
        s = next;
      }
    }
    if (abs(x - s) % 2 > 0) {
      if (p % 2 > 0) {
        p += 2;
      } else {
        p += 1;
      }
    }
    cout << p;
  }
  if (x == 0) {
    cout << 0;
  }
  return 0;
}
