#include <bits/stdc++.h>
using namespace std;
long long x;
int main() {
  cin >> x;
  x = abs(x);
  long long res = 0;
  while ((res * (res + 1)) / 2 < x || (x - ((res * (res + 1)) / 2)) % 2) res++;
  cout << res << endl;
  return 0;
}
