#include <bits/stdc++.h>
using namespace std;
int n2, x, y;
int dfs(int n, int i, int j) {
int t = n2 * n2 - n * n;
if (x == i)
return t + y;
if (y == n)
return t + x - 1;
if (x == n)
return t + 3 * n - y - 1;
if (y == j)
return t + 4 * n - x - 2;
x -= 1, y -= 1;
return dfs(n - 2, i, j );
}
int main() {
cin >> n2 >> x >> y;
cout << dfs(n2, 1, 1);
return 0;
}