def resolve():
    n = int(input())
    a = list(map(int, input().split()))

    money = 1000
    kab = 0

    maxa = max(a)
    mina = min(a)
    last = 0
    first = 0
    for i in range(n):
        if a[i] == maxa:
            last = i
    for i in range(n):
        if a[i] == mina:
            first = i
            break

    if a[0] == maxa:
        print(1000)
    else:
        if last > first:
            for i in range(first, last):
                if a[i] < a[i+1]:
                    kab += (money//a[i])
                    money %= a[i]
                elif a[i] > a[i+1]:
                    money += kab * a[i]
                    kab = 0
            print(kab*a[-1]+money)
        else:
            for i in range(last):
                if a[i] < a[i + 1]:
                    kab += (money // a[i])
                    money %= a[i]
                elif a[i] > a[i + 1]:
                    money += kab * a[i]
                    kab = 0

            print(kab * a[-1] + money)
resolve()