//KZNS
#include <fstream>
using namespace std;
//
ifstream fin ("nucle.in");
ofstream fout ("nucle.out");
//
int N, M;
long long f[60][6] = {0};
//
int main() {
fin >> N >> M;
f[1][1] = 1;
f[1][0] = 1;
for (int i = 2; i <= N; i++) {
for (int j = 0; j < M; j++)
f[i][0] += f[i-1][j];
for (int j = 1; j < M; j++)
f[i][j] = f[i-1][j-1];
}
long long as = 0;
for (int i = 0; i < M; i++)
as += f[N][i];
fout << as;
return 0;
}
//UBWH