#include <iostream>
#include <cmath>
using namespace std;
int cnt = 0;
int n, k;
void dfs (int prev, int len){
if (len == n) {
return void(++cnt);
}
for (int i = 0; i < 10; ++i){
if (!i && !len) continue;
if (abs(i - prev) >= k){
dfs(i, len + 1);
}
}
}
int main (int argc, char *argv[]){
while (cin >> n >> k){
dfs(-99999, 0);
cout << cnt << endl;
cnt = 0;
}
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgY250ID0gMDsKCmludCBuLCBrOwp2b2lkIGRmcyAoaW50IHByZXYsIGludCBsZW4pewoJaWYgKGxlbiA9PSBuKSB7CgkJcmV0dXJuIHZvaWQoKytjbnQpOwoJfQoJZm9yIChpbnQgaSA9IDA7IGkgPCAxMDsgKytpKXsKCQlpZiAoIWkgJiYgIWxlbikgY29udGludWU7CgkJaWYgKGFicyhpIC0gcHJldikgPj0gayl7CgkJCWRmcyhpLCBsZW4gKyAxKTsKCQl9Cgl9Cn0KCmludCBtYWluIChpbnQgYXJnYywgY2hhciAqYXJndltdKXsKCXdoaWxlIChjaW4gPj4gbiA+PiBrKXsKCQlkZnMoLTk5OTk5LCAwKTsKCQljb3V0IDw8IGNudCA8PCBlbmRsOwoJCWNudCA9IDA7Cgl9Cn0K