N = int(input())
A = list(map(int,input().split()))
# print('A:',A)

L=[]
ave = sum(A) / N
for i in range(N):
    if A[i]<ave:
        L.append(0)
    else:
        L.append(1)


out=0
money=1000
kabu=0
for i in range(N-1):
    if L[i]==0:
        kabu+=money // A[i]
        money=money % A[i]

    else:
        money+=kabu*A[i]
        kabu=0
    # print('money,kabu:',money,kabu)
money+=kabu*A[N-1]  #last
out=max(out,money)

if out<1000:
    print(1000)
else:
    print(out)
