#include <bits/stdc++.h>
int main() {
  int x;
  while (scanf("%d", &x) != EOF) {
    if (x < 0) x = -x;
    int cnt = 0, cot = 0;
    while (cot < x) {
      cot += ++cnt;
    }
    while ((cot - x) % 2 > 0) {
      cot += ++cnt;
    }
    printf("%d\n", cnt);
  }
  return 0;
}
