#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000");
using namespace std;
int main() {
  long long x, tmp = 0, ans = 0;
  scanf("%I64d", &x);
  x = abs(x);
  while (ans < x || ((ans - x) & 1)) tmp++, ans += tmp;
  printf("%I64d\n", tmp);
  return 0;
}
