n = int(input())
ary = list(map(int,input().split()))
money = 1000
kabu = 0

for i in range(n-1):
    if ary[i] < ary[i+1]:
        kabu += money//ary[i]
        money -= kabu*ary[i]
    elif ary[i] > ary[i+1]:
        money += kabu*ary[i]
        kabu = 0

print(money+kabu*ary[n-1])
