N = int(input())
A = list(map(int, input().split()))

ans = 1000
tmp = A[0]
flg = False
for i in range(1, N):
    if flg:
        tmp = A[i]
        flg = False
        
    if tmp < A[i]: #真に大きい時
        cnt = ans//tmp
        ans += (A[i]-tmp) * cnt
        flg = True #株を売買した
    else:
        tmp = A[i]
print(ans)
