#include <bits/stdc++.h>
using namespace std;
int main() {
  int q, w = 0, e, r, t;
  cin >> q;
  if (q < 0) q = -q;
  for (e = 1; w < q; e++) w += e;
  while ((w - q) % 2) {
    w += e;
    e++;
  }
  cout << e - 1;
  return 0;
}
