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

kau = [0]*n
index = []

if a[0] < a[1]:
    kau[0] = 1
for i in range(1, n-1):
    if a[i-1] > a[i]:
        for j in range(i+1, n):
            if a[i] < a[j]:
                kau[i] = 1
                break
            if a[i] > a[j]:
                break
for i, j in enumerate(kau):
    if j == 1:
        index.append(i)
index.append(n)

ans = 1000
for i in range(len(index)-1):
    kabu = ans//a[index[i]]
    ans -= a[index[i]]*kabu
    ans += max(a[index[i]:index[i+1]])*kabu
        
print(ans)