#!/bin/python import sys def longestSequence(a): # Return the length of the longest possible sequence of moves. total=0 for item in a: ld=[] if item==1: total=total+1 continue for i in range(1,item): if item%i==0: ld.append(i) cur=ld[0] for j in ld: if (j%cur)==0: #print j total=total+(item/j) cur=j total=total+1 return total if __name__ == "__main__": n = int(raw_input().strip()) a = map(long, raw_input().strip().split(' ')) result = longestSequence(a) print result