n=int(input())
a=list(map(int, input().split())) 
m = 1000
tmp = 999

for i in range(n):
    if tmp > a[i]:
        kb = int(m / a[i])
        d = m - kb * a[i]
        tmp = a[i]
    elif tmp < a[i] and kb != 0:
        m = kb * a[i] + d
        tmp = a[i]
        kb = 0

print(m)