#!/bin/python3 import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. steps = 0 for aaa in a: n = aaa if n != 1: steps += 1 while True: new_a = None dd = list() for d in range(2,n)[::-1]: if n % d == 0: dd.append(d) if not dd: new_a = 1 else: for d1 in dd: hit = True for d2 in dd: if d2 != d1 and d1 % d2 == 0: hit = False break; if hit: new_a = n//d1 break steps += aaa // new_a #print(n, new_a, steps) n = new_a if n == 1: break return steps if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)