n = int(input())
a = list(map(int,input().split()))
lis = [0]*n
sw = 0
for i in range(n):
    if sw == 0 and i >= 1 and a[0] > a[i]:
        sw = 1
    if i == n-1:
        break
    if a[i] > a[i+1]:
        lis[i] = -1
b = a[::-1]
for i in range(n-1):
    if b[i] < b[i+1]:
        if lis[n-i-1] == -1:
            pass
        else:
            lis[n-i-1] = 1
lis[-1] = -1
if sw == 0:
    lis[0] = 1
m = 1000
k = 0
for i in range(n):
    if lis[i] == 1:
        k += m//a[i]
        m = m%a[i]
    elif lis[i] == -1:
        m += k*a[i]
        k = 0
print(m)