#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m, n, p;
    cin>>m>>n>>p;
    int arr[n];
    int counter = 0;

    int red = p-1;
    int limit = 0, space = 0, start = 0;

    while(start+limit < n)
    {
        for(int i = start; i < n-limit; i++)
        {
            if(space == red)
            {
                arr[i] = m+counter;
            }
            counter++;
        }
        if(start+limit >= n)
        {
            break;
        }
        start++;
        for(int i = start; i < n-limit; i++)
        {
            if(i == red)
            {
                arr[n-1-space] = m+counter;
            }
            counter++;
        }
        if(start+limit >= n)
        {
            break;
        }
        for(int i = n-1-start; i >= limit; i--)
        {
            if(n-1-space == red)
            {
                arr[i] = m+counter;
            }
            counter++;
        }
        if(start+limit >= n)
        {
            break;
        }
        limit++;
        for(int i = n-1-start; i >= limit; i--)
        {
            if(i == red)
            {
                arr[space] = m+counter;
            }
            counter++;
        }
        if(start+limit >= n)
        {
            break;
        }
        space++;
    }

    long result = 0;

    for(int i = 0; i < n; i++)
    {
        result += arr[i];
    }
    cout<<result;
    return 0;
}
