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

int main()
{
    cin.tie(NULL);
    cout.tie(NULL);
    long long n,m,p,br=0,i=0,j=0,br2=0,sum=0,br3=0;
    cin>>m>>n>>p;
    long long tablica[n][n];
        for(long long j=0;j<n-1;j++){
        tablica[0][j]=m+br;
        br++;
        ///cout<<tablica[0][j]<<" ";
    }
    ///cout<<endl;
    for(long long i=0;i<n-1;i++){
        tablica[i][n-1]=m+br;
        br++;
        ///cout<<tablica[i][n-1]<<" ";
    }
    ///cout<<endl;
    for(long long j=n-1;j>=1;j--){
        tablica[n-1][j]=m+br;
        br++;
        ///cout<<tablica[n-1][j]<<" ";
    }
   /// cout<<endl;
    for(long long i=n-1;i>=1;i--){
        tablica[i][0]=m+br;
        br++;
        ///cout<<tablica[i][0]<<" ";
    }
    ///cout<<endl;
    for(long long j=1;j<=n-2;j++){
        tablica[1][j]=m+br;
        br++;
        ///cout<<tablica[1][j]<<" ";
    }
    while(true){
            br3=0;
        for(long long i=0+2+br2;i<=n-2-br2;i++){
            tablica[i][n-2-br2]=m+br;
            br++;
            br3++;
        }
        for(long long i=n-2-br2;i>=0+1+br2;i--){
            tablica[n-2-br2][i]=m+br;
            br++;
            br3++;
        }
        for(long long i=n-3-br2;i>=0+2+br2;i--){
            tablica[i][0+1+br2]=m+br;
            br++;
            br3++;
        }
        for(long long i=0+2+br2;i>=+3+br2;i++){
            tablica[0+2+br2][i]=m+br;
            br++;
            br3++;
        }
        br2++;
        if(br3==0){
            goto label3;
        }
    }
label3:
    ///cout<<endl;
    for(long long i=0;i<n;i++){
        sum=sum+tablica[p-1][i];
        ///cout<<tablica[p-1][i]<<" ";
    }
    cout<<sum+1;

    return 0;
}


