n = int(eval(input()))

a = list(map(int,input().split()))

m = 1000

stocks = 0

drops = [False]*(n-1)

for i in range(n-1):

    if a[i] > a[i+1]:

        drops[i] = True

for i in range(n-1):

    if drops[i]:

        m+=stocks*a[i]

        stocks = 0

    else:

        stocks+=m//a[i]

        m -= (m//a[i])*a[i]

print((m + stocks*a[-1]))
def main():

    N=int(eval(input()))

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

    ans=1000

    stocks=0

    for i in range(N-1):

        if A[i]>A[i+1]:

            ans+=stocks*A[i]

            stocks=0

        else:

            stocks+=(ans//A[i])

            ans-=(ans//A[i])*A[i]

    print((ans+stocks*A[-1]))

if __name__=='__main__':

    main()
n = int(eval(input()))
a = list(map(int, input().split()))
m = 1000
stocks = 0
drops = [False] * (n - 1)
for i in range(n - 1):
    if a[i] > a[i + 1]:
        drops[i] = True
for i in range(n - 1):
    if drops[i]:
        m += stocks * a[i]
        stocks = 0
    else:
        stocks += m // a[i]
        m -= (m // a[i]) * a[i]
print((m + stocks * a[-1]))

def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 1000
    stocks = 0
    for i in range(N - 1):
        if A[i] > A[i + 1]:
            ans += stocks * A[i]
            stocks = 0
        else:
            stocks += ans // A[i]
            ans -= (ans // A[i]) * A[i]
    print((ans + stocks * A[-1]))


if __name__ == "__main__":
    main()

-n = int(eval(input())) -a = list(map(int, input().split())) -m = 1000 -stocks = 0 -drops = [False] * (n - 1) -for i in range(n - 1): -    if a[i] > a[i + 1]: -        drops[i] = True -for i in range(n - 1): -    if drops[i]: -        m += stocks * a[i] -        stocks = 0 -    else: -        stocks += m // a[i] -        m -= (m // a[i]) * a[i] -print((m + stocks * a[-1])) +def main(): +    N = int(eval(input())) +    A = list(map(int, input().split())) +    ans = 1000 +    stocks = 0 +    for i in range(N - 1): +        if A[i] > A[i + 1]: +            ans += stocks * A[i] +            stocks = 0 +        else: +            stocks += ans // A[i] +            ans -= (ans // A[i]) * A[i] +    print((ans + stocks * A[-1])) + + +if __name__ == "__main__": +    main()