n=int(input())
a=list(map(int,input().split()))
money=1000
kabu=0
newkabu=0
for i in range(n):
    if a[i] < a[i+1]:
        newkabu = money//a[0]
        kabu += newkabu
        money -= a[i] * newkabu
    elif a[i] > a[i+1]:
        money += kabu*a[i]
        kabu=0
    if i == n-1:
        money += kabu*a[0]
print(money)