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