# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

N=int(input())
A=list(map(int,input().split()))
MIN=INF
MAX=0
ans=1000
for x in A:
    if x<MIN:
        MIN=x
    elif x>MAX:
        MAX=x
    elif x<MAX and MIN<MAX:
        tmp=ans%MIN
        ans-=tmp*MIN
        ans+=tmp*MAX
        MIN=INF
        MAX=0
if MIN<MAX:
    tmp=ans//MIN
    ans-=tmp*MIN
    ans+=tmp*MAX
print(ans)