#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  n = abs(n);
  for (int i = 1, j = 1; n != 0 && !ans; i++, j += i)
    if (j == n || (j > n && !(j - n & 1))) ans = i;
  printf("%d", ans);
}
