N = int(input())
A = [int(x) for x in input().split()]

dif = [0 for _ in range(N)]
for i in range(1, N):
    if A[i-1] < A[i]:
        dif[i] = 1
    elif A[i-1] > A[i]:
        dif[i] = -1
    else:
        dif[i] = dif[i-1]

now = 0
kai, uri = set(), set()
for i in range(1, N):
    if now != dif[i]:
        if dif[i] == 1:
            uri.add(i)
            now = 1
        elif dif[i] == -1:
            kai.add(i)
            now = -1
#print(min(kai,default=0))
if min(uri,default=0) < min(kai,default=0):
    kai.add(0)
if max(kai,default=0) > max(uri,default=0):
    kai.remove(max(kai))
amar = 1000
kabu = 0


if len(uri) == 0:
    print(amar)

if len(kai) == 0:
    kabu = amar//A[0]
    amar = amar - kabu * A[0]
    amar = amar + kabu * A[1]
    kabu = 0
    print(amar)

else:

    for i in range(N):
        if i in kai:
            kabu = amar//A[i]
            amar = amar - kabu * A[i]
        if i in uri:
            amar = amar + kabu * A[i]
            kabu = 0
    print(amar)