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