#include <bits/stdc++.h>
using namespace std;
int main() {
  int x;
  scanf("%d", &x);
  x = abs(x);
  int sum = 0, last = 0;
  while (sum < x || (x - sum) % 2 != 0) {
    ++last;
    sum += last;
  }
  printf("%d\n", last);
  return 0;
}
