import strformat, streams, sequtils, strutils, algorithm, math, future, sets, tables, hashes
proc `ceilDiv`*[T](x, y: T): T = x div y + ord(x mod y != 0)
proc `//=`*(x: var SomeInteger; y: SomeInteger) = x = x div y
proc `%=`*(x: var SomeInteger; y: SomeInteger) = x = x mod y
var
    N = stdin.readLine.parseInt
    A = stdin.readLine.split.map(parseInt)
    ans = 1000
    amin = 1000
    amax = 0
    flag = newSeq[bool]()
    kabu = 0
    idx = 0
    top = 0

for i in 0..N-2:
    if A[i] < A[i+1]:
        kabu += ans div A[i]
        ans -= A[i] * kabu
    elif A[i] > A[i+1]:
        ans += A[i] * kabu
        kabu = 0
    top = max(top, ans)
    # echo ans, " ", kabu
var ans2 = 0
if A[N-2] < A[N-1]:
    ans2 += ans + kabu * A[N-1]
top = max([top, ans, ans2])
echo top


