There are $N$ integers $a_1,\ldots,a_N$ written on a whiteboard.
Here, $a_i$ can be represented as $a_i = p_{i,1}^{e_{i,1}} \times \ldots \times p_{i,m_i}^{e_{i,m_i}}$ using $m_i$ prime numbers $p_{i,1} \lt \ldots \lt p_{i,m_i}$ and positive integers $e_{i,1},\ldots,e_{i,m_i}$.
You will choose one of the $N$ integers to replace it with $1$.
Find the number of values that can be the least common multiple of the $N$ integers after the replacement.
## Constraints
* $1 \leq N \leq 2 \times 10^5$
* $1 \leq m_i$
* $\sum{m_i} \leq 2 \times 10^5$
* $2 \leq p_{i,1} \lt \ldots \lt p_{i,m_i} \leq 10^9$
* $p_{i,j}$ is prime.
* $1 \leq e_{i,j} \leq 10^9$
* All values in input are integers.
## Input
Input is given from Standard Input in the following format:
$N$
$m_1$
$p_{1,1}$ $e_{1,1}$
$\vdots$
$p_{1,m_1}$ $e_{1,m_1}$
$m_2$
$p_{2,1}$ $e_{2,1}$
$\vdots$
$p_{2,m_2}$ $e_{2,m_2}$
$\vdots$
$m_N$
$p_{N,1}$ $e_{N,1}$
$\vdots$
$p_{N,m_N}$ $e_{N,m_N}$
[samples]