# 2570. Primes Pair

We arrange the numbers between 1 and N (1 <= N <= 10000) in increasing order and decreasing order like this:

1 2 3 4 5 6 7 8 9 . . . N

N . . . 9 8 7 6 5 4 3 2 1

Two numbers faced each other form a pair. Your task is to compute the number of pairs P such that both numbers in the pairs are prime.

### 输入格式

The first line of input gives the number of cases, C (1 ≤ C ≤ 100). C test cases follow.

Each test case consists of an integer N in one line.

### 输出格式

For each test case, output P .

### 样例

Input
4
1
4
7
51

Output
0
2
2
6


605 人解决，717 人已尝试。

925 份提交通过，共有 2008 份提交。

1.3 EMB 奖励。