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