#include <iostream>

const int width = 8;
const int height = 8;

const bool maze[height][width] = {
    {0, 0, 0, 0, 0, 1, 1, 1},
    {0, 0, 1, 0, 0, 0, 0, 1},
    {0, 0, 0, 0, 0, 0, 0, 0},
    {0, 1, 0, 0, 0, 0, 0, 0},
    {0, 0, 0, 0, 1, 0, 0, 0},
    {0, 0, 0, 0, 0, 0, 0, 0},
    {1, 1, 0, 0, 0, 1, 0, 0},
    {1, 1, 0, 0, 0, 0, 0, 0},
};

int main() {
    int row[width + 1] = {};
    row[width - 1] = 1;

    for (int y = height - 1; y >= 0; y--) {
        for (int x = width - 1; x >= 0; x--) {
            row[x] = maze[y][x] ? 0 : row[x] + row[x + 1];
        }
    }

    std::cout << row[0] << std::endl;
}