#!/bin/python3 import sys import math def get_moves(c): if c == 1: return 1 if c % 2 == 0: return c + get_moves(c//2) for i in range(3, math.floor(math.sqrt(c)) + 1, 2): if c % i == 0: return c + get_moves(c//i) return c + 1 def longestSequence(a): total = 0 for c in a: total += get_moves(c) return total # Return the length of the longest possible sequence of moves. if __name__ == "__main__": n = int(input().strip()) a = list(map(int, input().strip().split(' '))) result = longestSequence(a) print(result)