import sys
from itertools import *
from bisect import *
from collections import *
from math import gcd
import heapq
input = lambda: sys.stdin.readline().rstrip("\r\n")
rint = lambda: int(input())
rlist = lambda: list(map(int, input().split()))
rgrid = lambda n: [rlist() for _ in range(n)]
fmin = lambda x, y: x if x < y else y
fmax = lambda x, y: x if x > y else y
# MOD = 998244353
MOD = 10**9 + 7
INF = float("inf")
def solve():
N = rint()
r = 0
i = 1
while i <= N:
q = N // i
j = N // q
r += q * (j - i + 1)
i = j + 1
return r - N
TT = 1
TT = rint()
for tc in range(TT):
ans = solve()
print(ans)
# print(*ans)
# print("Yes" if ans else "No")