#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
unsigned long long p = 1;
int main()
{
    int n, m, k;
    cin >> n >> m >> k;
    for(int i=1; i <= n; i ++)
    {
        p *= m;
    }
    cout << p - m << endl;
    return 0;
}