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

a=list(dict.fromkeys(a))

b = [0] * (len(a)+1)
b[0] = 1000
c = [0] * (len(a) + 1)

print(a)
for i in range(len(a)):
    if i % 2 == 0:
        b[i+1] = b[i] - (b[i] // a[i]) * a[i]
        c[i] += b[i] // a[i]
    else:
        b[i + 1] += c[i - 1] * a[i]

print(max(b))