#!/bin/python3 import sys input = sys.stdin.readline def gets(n): if n==1: return 1 d = 2 step = 1 res = n while d*d<=n: while n%d == 0: n = n // d if n>1: res+=n d+=step step=2 return res+1 if __name__ == "__main__": N = int(input().strip()) s = 0 for x in map(int, input().strip().split(' ')): s+=gets(x) print(s)