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

yosan = 1000
kabu = 1000//a[0]
syozi = 1000%a[0]
ans = 1000
tmp = 0
for i in range(1,n) :
    if a[i-1] < a[i] and kabu != 0:
        syozi += (kabu*a[i])
        kabu = 0
    elif a[i-1] > a[i] and syozi > a[i]:
        tmp = syozi//a[i]
        kabu += tmp
        syozi -= tmp*a[i]
    ans = max(syozi, ans)

print(ans)