#include <bits/stdc++.h>
int main() {
  long long int n, pos = 0, tojump = 1, jumped = 0;
  scanf("%lld", &n);
  if (n < 0) n = -n;
  while (pos != n) {
    if (pos < n) {
      pos += tojump;
      jumped++;
      tojump++;
    } else {
      while (pos % 2 != n % 2) {
        pos += tojump;
        jumped++;
        tojump++;
      }
      break;
    }
  }
  printf("%lld", jumped);
  return 0;
}
