#!/usr/bin/env python3
import sys

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

M = 1000
kabu = 0

cur = A[0]

for i in range(1,N):
    if cur > A[i]:
        # 持ってる株全部売る
        M = M + kabu * cur
        kabu = 0
    if cur < A[i]:
        # 所持金全部株に変える
        kabu = M // cur
        M = M % cur
    cur = A[i]

M = M + kabu * A[N-1]

print(M)