n = int(input())
a = list(map(int, input().split()))
m = 1000
s = 0

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