Problem1554--Numbers

1554: Numbers

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

DongDong is fond of numbers, and he has a positive integer P. Meanwhile, there is a rule that is:

A positive integer D that satisfies the following rules:

1.       D is one of the factors of P

2.       D and P have a same bit at least under the binary system.

So DongDong wants to know how many positive integers D there are.

Input

The first line contains a positive integer T (T<=1000), which means the number of test cases. Then comes T lines, each line contains a positive integer P (1<=P<=1000000000).

Output

For each test case, print the number of positive integers D that satisfies the rules.

Sample Input Copy

2
1
10

Sample Output Copy

1
2