#include<bits/stdc++.h>
using namespace std;



int main()
{
    short n, p, z = 0, sum = 0;
    int m;
    cin>>m>>n>>p;
    int br = n*n;
    while(br>0)
    {
        for(short j = z; j<n-z; j++)
        {
            if(0==p-1)
            {
                sum+=m;
            }
            m++;
            br--;
        }
        for(short i = z+1; i<n-z; i++)
        {
            if(i==p-1)
            {
                sum+=m;
            }
            m++;
            br--;
        }
        for(short j = n-z-2; j>=z; j--)
        {
            if(n-z-1==p-1)
            {
                sum+=m;
            }
            m++;
            br--;
        }
        for(short i = n-z-2; i>=z+1; i--)
        {
            if(i==p-1)
            {
                sum+=m;
            }
            m++;
            br--;
        }
        z++;
    }
    cout<<sum;
    return 0;
}
