Aaa
This and all following tasks are devoted to stories about a girl who has played an important role in the lives of the authors. It all began like this: During one of hundreds of absolutely unimportant lectures, senior student was evenly distributing Sudoku puzzles around herself. Sasha was also given one, and that was a preposition to speak. — I hope this is the most difficult level? — Just for you. — Well, well, — seeing a deep irony in her eyes and the fact that the first three lines are already filled. — If you solve this one, I'll give you another. — I won't just solve this, but I will say how many solutions exist, — said Sasha boastfully, not knowing what a problem he has created for himself. — Well, well, we'll see. The next two days Sasha was engaged only in looking for number of solutions for sudoku. By the way, sudoku is a puzzle in which it is proposed to fill a 9×9 table with numbers from 1 to 9 so that in every row, column and each of the 9 squares 3×3, all the numbers were different. Initially, some cells are already filled and you are to write the numbers in empty cells. — And what was the girl's name, again? — Oh...
Input
There are 3 lines, consisting of 9 integers from 1 to 9 in each. Those are first three lines of Sudoku.
Output
The only number: number of solutions. It is guaranteed that at least one solution exists.