N=int(input())
A=list(map(int,input().split()))
stuck=[0]*N
flag=False
for i in range(N):
    if A[N-i-1]>A[N-i-2]:
        base=A[N-i-1]
        break
else:
    print(1000)
    exit()
for i in range(N):
    money=A[N-i-1]
    if base<money and flag:
        stuck[i]=1
        flag=False
        base=money
    elif base>money and not flag:
        stuck[i]=-1
        flag=True
        base=money
flag=False
stuck=stuck[::-1]
money=1000
kabu=0
for i in range(N):
    if stuck[i]==-1:
        kabu=money//A[i]
        money-=A[i]*kabu
        flag=True
    elif stuck[i]==1:
        money+=A[i]*kabu
        flag=False
if flag:
    money+=A[-1]*kabu
print(money)