#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 2e5 + 10;
int main() {
  int n;
  cin >> n;
  n = abs(n);
  for (int i = 0; i <= N; i++) {
    int sum = i * (i + 1) / 2;
    if (sum < n) continue;
    if ((sum - n) % 2 == 1) continue;
    cout << i << endl;
    break;
  }
  return 0;
}
