from fractions import Fraction


test=int(input())
arr=[]
while(test>0):
    n=int(input())
    arr.append(n)
    test-=1
initial=list(arr)
arr.sort()
ans=set()
final={}

for i in range(2,arr[len(arr)-1]+1):
    for j in range(1,i):
        ans.add(str(Fraction(j,i)))
    if i in arr:
        final.update({i:len(ans)})

for a in initial:
    print(final.get(a))
68c25667718b48c0e16aa42b0481c9a51a347445
<mask token>

<mask token>
while test > 0:
    n = int(input())
    arr.append(n)
    test -= 1
<mask token>
arr.sort()
<mask token>
for i in range(2, arr[len(arr) - 1] + 1):
    for j in range(1, i):
        ans.add(str(Fraction(j, i)))
    if i in arr:
        final.update({i: len(ans)})
for a in initial:
    print(final.get(a))

<mask token>
test = int(input())
arr = []
while test > 0:
    n = int(input())
    arr.append(n)
    test -= 1
initial = list(arr)
arr.sort()
ans = set()
final = {}
for i in range(2, arr[len(arr) - 1] + 1):
    for j in range(1, i):
        ans.add(str(Fraction(j, i)))
    if i in arr:
        final.update({i: len(ans)})
for a in initial:
    print(final.get(a))

from fractions import Fraction
test = int(input())
arr = []
while test > 0:
    n = int(input())
    arr.append(n)
    test -= 1
initial = list(arr)
arr.sort()
ans = set()
final = {}
for i in range(2, arr[len(arr) - 1] + 1):
    for j in range(1, i):
        ans.add(str(Fraction(j, i)))
    if i in arr:
        final.update({i: len(ans)})
for a in initial:
    print(final.get(a))

from fractions import Fraction


test=int(input())
arr=[]
while(test>0):
    n=int(input())
    arr.append(n)
    test-=1
initial=list(arr)
arr.sort()
ans=set()
final={}

for i in range(2,arr[len(arr)-1]+1):
    for j in range(1,i):
        ans.add(str(Fraction(j,i)))
    if i in arr:
        final.update({i:len(ans)})

for a in initial:
    print(final.get(a))