#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0;
  cin >> n;
  if (n <= 0) n *= -1;
  for (int i = 0; i < n || (i % 2 != n % 2); i += ++k) {
  }
  cout << k << endl;
  return 0;
}
