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