#include <bits/stdc++.h>
int main() {
  int n;
  int sum = 0;
  int step = 0;
  scanf("%d", &n);
  if (n < 0) n = -n;
  while (sum < n) {
    step++;
    sum += step;
  }
  if (sum == n || (sum - n) % 2 == 0)
    ;
  else if ((step + 1) % 2 == 0)
    step += 2;
  else
    step++;
  printf("%d\n", step);
}
