import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
m = 1000
bm = a[0]
for i in range(1,n):
    if bm > a[i]:
        bm = a[i]
    elif bm < a[i]:
        sm = a[i]
        kb,m = divmod(m, bm)
        m = m + sm * kb
        if i+1< n:
            bm = a[i+1]
print(m)