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

m = 1000
s = 0

mx = [0] * n
for i in range(1, n):
    if a[i-1] < a[i]:
        mx[i] = 1
        mx[i-1] = 0
        
mn = [0] * n
for i in range(1, n):
    if a[i-1] > a[i]:
        mn[i] = 1
        mn[i-1] = 0
        
if a[0] < a[1]:
    mn[0] = 1
    
mn[-1] = 0

for i in range(n):
    if mx[i] == 1:
        m += s * a[i]
        s = 0
    if mn[i] == 1:
        s += m//a[i]
        m -= m//a[i] * a[i]

print(m)