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

long long m, n, p, k = 2, arr[1000000];

int main()
{
    cin >> m >> n >> p;
    int t = (n-1), r = (n-2), h = 1;
    for(int i = 1; i <= n * n; i++)
    {
        for(int j = m; j <= n * n; j++)
        {
            if(i < 5) arr[i] = j;
            else
            {
                if(k <= n)
                {
                    arr[k*n] = j;
                    k++;
                }
                else if(t > 0)
                {
                    arr[(n-1)*n + t] = j;
                    t--;;
                }
                else if(r > 1)
                {
                    arr[r*n+1] = j;
                    r--;
                }
                else if(h < n)
                {
                    arr[n+h] = j;
                    h++;
                }
            }
        }
    }
    long long sum = 0;
    for(int i = ((p-1)*n)+1; i <= 2*n; i++)
    {
        sum += arr[i];
    }
    cout << sum << endl;
    return 0;
}
