#include #define F first #define S second #define mp make_pair #define pb push_back #define ll long long #define LEFT(a) ((a)<<1) #define RIGHT(a) (LEFT(a) + 1) #define MID(a,b) ((a+b)>>1) #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) using namespace std; const int N = 1e5 + 5, MOD = 1e9 + 7; ll T; ll n, ans; int main() { cin>>T; while (T--){ cin>>n; ans += n; ll m = n; for (ll i = 2; i * i <= m; i++) while (m % i == 0){ m /= i; ans += m; } if (m > 1) ans ++; } cout<