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

money = 1000
num = 0
flag = False
a.append(a[n - 1])
for i in range(n):
    #print(num, money)
    if flag:
        flag = False
        continue
    if a[i] < a[i + 1]:
        num += money // a[i]
        money -= a[i] * num
    else:
        money += num * a[i + 1]
        num = 0
        flag = True
print(money)