import sys
from collections import deque
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    A = list(readnums())
    d = deque(A)
    d.appendleft(201)
    d.append(0)
    # ans = 1000 + (max(A) - min(A)) * (1000 // min(A))
    il = []
    for i in range(N):
        if d[i] <= d[i + 1] and d[i + 1] > d[i + 2]:
            il.append(i)
        elif d[i] >= d[i + 1] and d[i + 1] < d[i + 2]:
            il.append(i)

    if len(il) == 1:
        print(1000)
    else:
        b = 1000
        s = 0
        for i, v in enumerate(il):
            if not i % 2:
                s += b // A[v]
                b -= s * A[v]
            else:
                b += s * A[v]
                s = 0

        print(b)


if __name__ == "__main__":
    main()
