Mumatrix#5474

Mumatrix

2 segundos
256 megabytes
Media

The binary matrix is given. Find its square modulo .

Entrada

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 .

Salida

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

Ejemplos

Ejemplo 1

Loading
Loading