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


# 次の日の方が安いなら全て売る
# 次の日の方が高いなら全て買う
money = 1000
stock=0
for i in range(n-1):
    if a[i] < a[i+1]:
        stock += money//a[i]
        money -= stock * a[i]
    else:
        money += stock *a[i]
        stock =0

if stock >0:
    money+=stock*a[-1]
    stock=0
print(money)