For generating pseudo-random numbers, various methods are used. One of such methods is the use of Boolean recurrent expressions. In such a case, the pseudo-random number is represented as a bit sequence, such that each next bit is calculated from the previous ones using a certain formula. However, such a task actually determines the sequence of its first members.
An alternative is the use of Boolean equations. We will say that the bit sequence x1, x2, x3, ..., xn satisfies some equation
The first line of the input file contains an integer n (2 ≤ n ≤ 103).
The second line contains the left side of the equation, encoded in the following way:
The length of left side of the equation is not longer 1000 characters.
The output file contains a single number — the number of bit sequences of length n that satisfy the equation. The number should be modulo 260.
3
(0+2)|(0&2)
6
4
(0+2)|-(0&2)
9
The first example encodes the equation (xi + xi - 2)|(xi&xi - 2) = 1, which satisfies the following sequence: 001, 011, 100, 101, 110, 111.
The second example encodes the equation (xi + xi - 2)|( - (xi&xi - 2)) = 1, which is satisfied by the sequence: 0000, 0001, 0010, 0011, 0100, 0110, 1000, 1001, 1100.
| Name |
|---|


