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