#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, x, y;
std::cin >> n >> x >> y;
int a[105][105];
int tmp = 1;
for (int i = 0; i < n / 2 + 1; ++i)
{
for(int j = i; j < n - i; ++j)
{
a[i][j]=tmp++;
}
for(int j = i + 1; j < n - i; ++j)
{
a[j][n-i-1]=tmp++;
}
for(int j = n - i - 2; j > i; --j)
{
a[n-i-1][j]=tmp++;
}
for(int j = n - i - 1; j > i; --j)
{
a[j][i]=tmp++;
}
}
cout << a[x-1][y-1];
}
/**************************************************************
Problem: 2332
User: hongyipin
Language: C
Result: Compile Error
****************************************************************/