n = int(input()) l = [int(i) for i in (input().strip().split(" "))] l.sort() c = 0 # 时间 k = 0 # 楼层 c += 4*l[-1] for i in l: if i != k: c += 6 * (i-k) + 5 + l.count(i) k = i print(c)