Mumatrix#5474

Mumatrix

2 seconds
256 megabytes
Medium

The binary matrix is given. Find its square modulo .

Input

The first line contains the size of the matrix (1 \leq n \leq 4000). Each of the next lines contains symbols, each equal to or .

Output

Print one number — the amount of ones in the squared matrix.

Examples

Example 1

Loading
Loading