n=int(input())
a=list(map(int,input().split()))
a.append(0)
m=1000
s=0
for i in range(n):
    if a[i]<a[i+1]:
        s=m // a[i]
        m=m % a[i]
    elif a[i]==a[i+1]:
        pass
    else:
        m=m + s * a[i]
        s=0
print(m)