#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    m = 1000
    c = 0

    dif = [t1 - t0 for t0,t1 in zip(A[:-1], A[1:])]
    pre = 0
    for d in range(N-1):
        if dif[d] == 0:
            dif[d] = pre
        pre = dif[d]


    if dif[0] > 0:
        c = m // A[0]
        m -= A[0] * c
    for i in range(1,N-1):
        if (dif[i-1] < 0)and(dif[i]>0):
            c = m // A[i]
            m -= A[i] * c
        elif (dif[i-1] > 0)and(dif[i]<0):
            m += A[i] * c
            c = 0
    
    m += A[N-1] * c
    c = 0

    print(m)

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
