#include <bits/stdc++.h> using namespace std; int n,m,b=1; int main(){ cin>>n>>m; while(m--){ b=b+n*b; } cout<<b; return 0; }