#coding:utf-8
n=input()
a=[int(i) for i in input().split()]
a.sort()
max=0
f=0
for i in range(1,20000,2):
  for j in range(len(a)):
    if(a[j]%2==0):
      f+=1
      continue;
    f+=i%a[j]
  if(max<f):
    max=f
  f=0
print(max)