#include <bits/stdc++.h>
int x, ans;
int main() {
  scanf("%d", &x);
  x = abs(x);
  for (int i = 1, t = 1; x && !ans; t += ++i)
    if (t == x || (t > x && !((t - x) % 2))) ans = i;
  printf("%d", ans);
}
