#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. count = 0 for i in a: count += getCount(i) return count def getCount(i, count): if i == 1: return 0 else: for x in xrange(i/2, 1, -1): if i%x == 0: count = i/x * getCount(i/x) return count if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result