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