#include <bits/stdc++.h>
using namespace std;
int x;
int i, j;
int main() {
  scanf("%d", &x);
  x = abs(x);
  for (; j < x; j += ++i)
    ;
  printf("%d", (x & 1) == (j & 1) ? i : i + 1 + (i & 1));
}
