n,*aa = map(int, open(0).read().split())

ans = 1000

mn=mx=aa[0]

for i in range(1,n):
    if mn<=aa[i] and mx<=aa[i]:
        mx = aa[i]
    elif aa[i]<=mn and aa[i]<=mx:
        mn=mx=aa[i]
    else:
        ans += (mx-mn)*(ans//mn)
        mn=mx=aa[i]
ans += (mx-mn)*(ans//mn)

print(ans)