Alice and Bob are really bored today, they want to play Tic-tac-toe.
The rules are basically the same as the general Tic-tac-toe chess. Two players, Alice and Bob, take turns to play on a $3 \times 3$ board. Alice goes first. The goal is to full fill their own chess pieces in a certain row, a certain column or a certain diagonal to form a continuous connection.
In our problem, the rules are somewhat different. Even if one player has reached a row (or a column or diagonal) connection, the game will continue until all the nine position are placed. Finally, we denote the number of connections of Alice minus the number of connections of Bob as the final score of the game. Alice wants to maximize the total score, while Bob wants to minimize it.
Due to some mysterious power, there have some chess pieces on the chessboard already. Alice and Bob want you to help calculate the final score starting with the given situation.
You can assume that Alice and Bob are both very smart.