#include <bits/stdc++.h>
int main() {
  int tp, x, ans;
  while (~scanf("%d", &x)) {
    x = x < 0 ? -x : x, ans = ceil((-1 + sqrt(1 + 8.0 * x)) / 2),
    tp = ans * (ans + 1) / 2 - x;
    while (tp & 1) ans++, tp += ans;
    printf("%d\n", ans);
  }
  return 0;
}
