{"raw_statement":[{"iden":"problem statement","content":"Snuke has a grid with $H$ rows and $W$ columns. The square at the $i$\\-th row and $j$\\-th column contains a character $S_{i,j}$.\nHe can perform the following two kinds of operation on the grid:\n\n*   Row-reverse: Reverse the order of the squares in a selected row.\n*   Column-reverse: Reverse the order of the squares in a selected column.\n\nFor example, reversing the $2$\\-nd row followed by reversing the $4$\\-th column will result as follows:\n![image](https://atcoder.jp/img/code-festival-2016-final/31458935865e5db21bfbcd2eab9511da.png)\nBy performing these operations any number of times in any order, how many placements of characters on the grid can be obtained?"},{"iden":"constraints","content":"*   $1≦H,W≦200$\n*   $S_{i,j}$ is a lowercase English letter (`a`\\-`z`)."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H$ $W$\n$S_{1,1}$$S_{1,2}$$...$$S_{1,W}$\n$S_{2,1}$$S_{2,2}$$...$$S_{2,W}$\n$:$\n$S_{H,1}$$S_{H,2}$$...$$S_{H,W}$"},{"iden":"sample input 1","content":"2 2\ncf\ncf"},{"iden":"sample output 1","content":"6\n\nThe following $6$ placements of characters can be obtained:\n![image](https://atcoder.jp/img/code-festival-2016-final/ddf2925467af2c9734194a886f819a2b.png)"},{"iden":"sample input 2","content":"1 12\ncodefestival"},{"iden":"sample output 2","content":"2"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}