q=int(input())
izlaz=[]
for i in range(q):
    n=int(input())
    br=[]
    pr=2
    for j in range(2,n//2+1):
        for x in range(j,n+1,pr):
            br.append(x)
        pr*=j+1

    raz=len(br)
    
    izlaz.append(raz)

    
print(*izlaz,sep="\n")