/* Wasiful Haque */
#pragma GCC optimize("O3,unroll-loops")
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
#define fastIO() ios_base :: sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD 1000000007
#define INF 1e18
#define PI 3.141592653589793238462
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define forI(i, s, n) for(int i=s; i<n; i++)
#define forI_R(i, n, s) for(int i=n; i>=s; i--)
#define inputArr(n, arr) for(int i=0; i<n; i++){cin >> arr[i];}
#define forI_list(it, l) for(auto it=l.begin(); it != l.end(); it++)
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vector<int>>
#define vvll vector<vector<long long>>
#define u_mii unordered_map<int,int>
#define mii map<int,int>
#define mic map<int,char>
#define msi map<string,int>
#define pii pair<int,int>
#define pq_max priority_queue<int>
#define pq_min priority_queue<int, vector<int>, greater<int>>
#define yes cout << "YES\n"
#define no cout << "NO\n"
typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key
/* Error Debugging (Start) */
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x << " "; _print(x); cerr << endl;
#else
#define debug(x)
#endif
void _print(long long x) {cerr << x;}
void _print(int x) {cerr << x;}
void _print(string x) {cerr << x;}
void _print(char x) {cerr << x;}
void _print(long double x) {cerr << x;}
void _print(double x) {cerr << x;}
void _print(unsigned long long x) {cerr << x;}
template <class T, class V> void _print(pair <T, V> x);
template <class T> void _print(vector <T> x);
template <class T> void _print(set <T> x);
template <class T> void _print(multiset <T> x);
template <class T, class V> void _print(map <T, V> x);
template<class T, class V> void _print(pair<T, V> x){cerr << "{"; _print(x.first); cerr << ","; _print(x.second); cerr << "}";}
template<class T> void _print(vector<T> x){cerr << "[ "; for(auto i : x) {_print(i); cerr << " ";} cerr << "]";}
template<class T> void _print(set<T> x){cerr << "[ "; for(auto i : x) {_print(i); cerr << " ";} cerr << "]";}
template<class T> void _print(multiset<T> x){cerr << "[ "; for(auto i : x) {_print(i); cerr << " ";} cerr << "]";}
template<class T, class V> void _print(map<T, V> x){cerr << "[ "; for(auto i : x) {_print(i); cerr << " ";} cerr << "]";}
/* Error Debugging (End) */
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
/* Algorithms (Start) */
const int N = 1000000;
vll primes;
vector<bool> is_prime(N + 1, true);
void sieve() {
is_prime[0] = is_prime[1] = false;
for (ll i = 2; i <= N; i++) {
if (is_prime[i]) {
primes.push_back(i);
if (i * i <= N) {
for (ll j = i * i; j <= N; j += i) {
is_prime[j] = false;
}
}
}
}
}
/* Algorithms (End) */
/* Code (Start) */
void solve(){
ll n; cin >> n;
if(n == 0) {
cout << 0 << endl;
return;
}
map<ll, ll> freq;
freq[1]++;
if(n != 2){
forI(i, 2, sqrt(n)+1){
int x = n;
while(x > 0){
if( (x % i) == 0){
freq[i]++;
freq[x/i]++;
x/=i;
}
else break;
}
}
}
ll ans=0;
for(auto &val : freq){
ans += val.first;
}
cout << ans << endl;
}
int main(){
#ifndef ONLINE_JUDGE
freopen("error.txt", "w", stderr);
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
#endif
fastIO();
auto start1 = high_resolution_clock::now();
int t; cin >> t;
while(t--){
solve();
}
auto stop1 = high_resolution_clock::now();
auto duration = duration_cast<milliseconds>(stop1 - start1);
#ifndef ONLINE_JUDGE
cerr << "Time: " << duration.count() << " ms" << endl;
#endif
return 0;
}