n = int(input())
a = list(map(int, input().split())) 

kabu = 0
money = 1000
for i in range(n):
    if i == n-1:
        money += kabu*a[i]
        kabu = 0
    elif a[i] < a[i+1]:
        while money >= a[i]:
            kabu += 1
            money -= a[i]
    else:
        money += kabu*a[i]
        kabu = 0
    
print(money)
    