Problem name: John

Problem ID: 19008

Problem setter: Stefanita Fechete

Problem input: standard input

Problem output: standard output

Background:

John has a big dining room (size 9x9). One day his crazy little son playing with his favourite toy, a big hammer, has distroied some parts of the parquet. As John wants to repare the floor, he has 2 kind of parquet pieces:
    
  ## (1x2) & ## (2x2, with one empty square)
              #    

Problem:

John wants to repare his floor and I want you to tell me in how many different ways he can arrange the pieces?

Input data:

9 lines: each line contains the position where the floor is damaged. Each line ends with 0.

Output data:

Single number: the number of solutions.

Example:

input:

   1 2 3 0   
   1 2 3 0
   0
   0 
   0
   0
   0
   0
   0

output:

5

Restrictions:

1