#include <iostream>
using namespace std;

int main(){
    int n, d, k, sb, sk;
    sk = 1;
    sb = 0;
    cin>>n;
    cin>>d;
    cin>>k;

    for(int i = 1; i <= k; i = i + 1){

        if(sk == 1){
            sb = sk + (n - sk);
            sk = 2;
        }

        if(sk == 2){
            sb = sk + n;
            sk = 3;

        }

        if(sk == 3){
            sb = sk + 1;
            sk = 1;

        }
    }
    cout<<sb;

    return 0;
}
