#include <bits/stdc++.h>
using namespace std;
const int maxn = 2006;
long long x, d;
int read() {
  char ch = getchar();
  int x = 0, f = 1;
  while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
  return x * f;
}
int main() {
  x = abs(read());
  int tot = 0, pos = 0, cnt = 1;
  if (!x) {
    cout << 0;
    return 0;
  }
  while (pos != x) {
    if (pos > x && (pos - x) % 2 == 0) break;
    pos += cnt;
    cnt++;
  }
  cout << cnt - 1;
  return 0;
}
