#include <bits/stdc++.h>
using namespace std;
inline int cmp(double x, double y = 0, double tol = 1E-10) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
int X;
map<int, pair<int, int> > D;
int main() {
  scanf("%d", &X);
  if (X == 0) {
    printf("0\n");
    return 0;
  }
  if (X == 1 || X == -1) {
    printf("1\n");
    return 0;
  }
  X = abs(X);
  int v = 1, d = 1, k = 1;
  D[1] = pair<int, int>(1, 1);
  do {
    k ^= 1;
    d++;
    v += d;
    D[v] = pair<int, int>(d, k ? 2 : 1);
  } while (v > 0 && v <= X);
  map<int, pair<int, int> >::iterator I = D.lower_bound(X);
  printf("%d\n",
         I->second.first + ((I->first % 2 != X % 2) ? I->second.second : 0));
  return 0;
}
