int n ;
while (cin >> n)
{
n = n > 0 ? n : 0 - n;
int index = 1;
int sum = 0;
while (sum < n)
{
sum += index;
index++;
}
if ((sum - n) % 2 == 0)
{
cout << index - 1 << endl;
}
else {
if (index % 2 == 1)
{
cout << index << endl;
}
else
{
cout << index + 1 << endl;
}
}
}