from collections import deque

n = int(input())
a = list(map(int,input().split()))
m = 1000
ans = 1000
ans_list=[]

q = deque([[1000, 0, n, 0]])

while len(q) != 0:
    tmp = q.popleft()
    m,k,d,i = tmp[0],tmp[1],tmp[2],tmp[3]
    if d == 0 and m > ans:
        ans = m
        ans_list.append(m)
    elif d > 1:
        x = m//a[i]
        q.append([m-(x*a[i]),x+k,d-1,i+1])
        q.append([m+(k*a[i]),0,d-1,i+1])
        q.append([m,k,d-1,i+1])
    elif d == 1:
        q.append([m+(k*a[i]),0,d-1,i+1])

print(ans)
