#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, n, s;
  cin >> x;
  if (x < 0) x = -x;
  for (s = 0, n = 0;; n++) {
    s += n;
    if (s >= x && s % 2 == x % 2) break;
  }
  cout << n << endl;
  return 0;
}
