题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2601
#include<bits/stdc++.h>
using namespace std;
#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define ll long long
#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
#define mst(a,b) memset((a),(b),sizeof(a))
const int maxn =1e3+5;
const int mod=9999991;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x%mod) if(y&1) t=t*x%mod; return t;}
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*
简单的数学式子搞一搞就行了。
n+1=(i+1)*(j+1),
然后把n+1根号之内的因子数量筛出来就行。
*/
ll n;
int main()
{
int t;scanf("%d",&t);
while(t--)
{
scanf("%lld",&n);n++;
int cnt=0;
for(int i=2;1LL*i*i<=n;i++) if(n%i==0)
{
cnt++;
}
printf("%d\n",cnt);
}
return 0;
}