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