#include <iostream>

int count = 0;
const int SIZE = 6;
const int delta[8][2] = { 1, 0, 1, 1, 0, 1, -1, 1, -1, 0, -1, -1, 0, -1, 1, -1};

class board
{
private:
	int b[SIZE][SIZE];
	int next;
public:
	bool can_put;
	board();
	bool empty(int, int);
	board put_piece(int, int);
	void judge();
	board pass();
	friend ostream& operator<<(ostream&, const board&);
};

board::board()
{
	for(int i = 0; i < SIZE; i++)
	{
		for(int j = 0; j < SIZE; j++)
		{
			b[i][j] = 0;
		}
	}
	b[SIZE / 2][SIZE / 2] = 1;
	b[SIZE / 2 - 1][SIZE / 2 - 1] = 1;
	b[SIZE / 2 - 1][SIZE / 2] = 2;
	b[SIZE / 2][SIZE / 2 - 1] = 2;
	next = 1;
	can_put = true;
}

bool board::empty(int x, int y)
{
	return (b[x][y] == 0)? true: false;
}

board board::put_piece(int x, int y)
{
	int nx, ny;
	bool flag;
	board temp = *this;

	temp.can_put = false;
	for(int i = 0; i < 8; i++)
	{
		flag = false;
		nx = x + delta[i][0];
		ny = y + delta[i][1];
		for(; nx >= 0 && nx < SIZE && ny >= 0 && ny < SIZE; nx += delta[i][0], ny += delta[i][1])
		{
			if(temp.b[nx][ny] == 0){
				break;
			}else if(temp.b[nx][ny] == next){
				if(flag){
					for(; nx != x || ny != y;nx -= delta[i][0], ny -= delta[i][1])
					{
						temp.b[nx][ny] = next;
					}
					temp.can_put = true;
				}
				break;
			}else{
				flag = true;
			}
		}
	}
	if(temp.can_put){
		temp.b[x][y] = next;
		temp.next = 3 - next;
	}
	return temp;
}

void board::judge()
{
	int count1 = 0, count2 = 0;
	for(int i = 0; i < SIZE; i++)
	{
		for(int j = 0; j < SIZE; j++)
		{
			if(b[i][j] == 1){
				count1++;
			}else if(b[i][j] == 2){
				count2++;
			}
		}
	}
	cout << "1 : " << count1 << ", 2 : " << count2 << endl;
}

board board::pass()
{
	board temp = *this;
	temp.next = 3 - temp.next;
	return temp;
}

ostream& operator<<(ostream& out, const board& temp)
{
	for(int i = 0; i < SIZE; i++)
	{
		for(int j = 0; j < SIZE; j++)
		{
			out << "[" << temp.b[i][j] << "]";
		}
		out << endl;
	}
	return out;
}

void run(board temp)
{
	bool flag = true;
	board temp1;

	for(int i = 0; i < SIZE; i++)
	{
		for(int j = 0; j < SIZE; j++)
		{
			if(temp.empty(i, j)){
				temp1 = temp.put_piece(i, j);
				if(temp1.can_put){
					flag = false;
					run(temp1);
				}
			}
		}
	}
	if(flag){
		for(int i = 0; i < SIZE; i++)
		{
			for(int j = 0; j < SIZE; j++)
			{
				if(temp.pass().empty(i, j)){
					temp1 = temp.put_piece(i, j);
					if(temp1.can_put){
						flag = false;
						run(temp1);
					}
				}
			}
		}

	}
	if(flag){
		temp.judge();
	}
}

main()
{
	board temp;
	run(temp);
	cout << count << endl;
}

