﻿#include <iostream>
#include <cassert>

using namespace std;

int wh(int x, int y) {
    assert(y <= 8&&y>=1&&x>=1&&x<=8);
    if (y == 8) {
        return 1;
    }
    if(x==1)
        return wh(x+1, y+1);
    else if (x==8)
        return wh(x - 1, y + 1);
    else
        return wh(x - 1, y + 1) + wh(x + 1, y + 1);
}

int main()
{
    int x,y;
    cin >> x>>y;
    cout<<wh(x, y );
    return 0;
}

