#!/bin/python import sys def longestSequence(a): sequence = 0 for i in a: if i == 1: sequence += 1 continue tmp = 1 pFac = [] p = 2 while p ** 2 <= i: if i % p: p += 1 else: i //= p pFac.append(p) if i > 0: pFac.append(i) for i in range(len(pFac) -1, -1, -1): sequence += pFac[i] * tmp tmp *= pFac[i] sequence += 1 return sequence # Return the length of the longest possible sequence of moves. if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result