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