n = int(input())
a = list(map(int, input().split()))
h = 0
m = 1000
for i in range(n):
    if i==0 and a[1]>a[0]:
        h1 = m//a[i]
        h += h1
        m -= a[i] * h1
    elif i==n-1:
        m += a[i] * h
        h = 0
    else:
        if a[i+1] > a[i] and a[i] > min(a[i+1::]) or a[i] > max(a[i+1::]):
            m += a[i] * h
            h = 0
        elif a[i+1] < a[i]:
            h1 = m//a[i]
            h += h1
            m -= a[i] * h1

print(m)