#include <bits/stdc++.h>
int main() {
  int i, x, t, s;
  while (scanf("%d", &x) != EOF) {
    if (x < 0) x = -x;
    t = ceil((-1 + sqrt(1 + 8.0 * x)) / 2.0);
    s = t * (t + 1) / 2 - x;
    while (s & 1) {
      t++, s += t;
    }
    printf("%d\n", t);
  }
  return 0;
}
