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



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