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