#include <bits/stdc++.h>
int sum(int x) { return x * (x + 1) / 2; }
int main() {
  int n, s;
  while (scanf("%d", &n) != EOF) {
    if (n < 0) n = -n;
    int ans = 0;
    while (true) {
      s = sum(ans);
      if ((s - n) % 2 > 0 || (s < n))
        ans++;
      else
        break;
    }
    printf("%d\n", ans);
  }
}
