import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))

lst = []
small, large = 0, 0
for i in range(N):
    if large==0:
        small = A[i]
        large = A[i]
    else:
        if A[i] < large:
            if small < large:
                lst.append((small,large))
                small, large = 0, 0
            else:
                small = A[i]
                large = A[i]
        else:
            large = A[i]
else:
    if small < large:
        lst.append((small,large))
# print(lst)
ans = 1000
for s, l in lst:
    stock, ans = divmod(ans, s)
    ans += stock * l
print(ans)