import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    A = list(map(int, readline().split()))
    money = 1000
    stock = 0
    for i in range(N-1):
        if A[i+1]>A[i]:
            stock += money//A[i]
            money -= stock * A[i]
        elif A[i+1] < A[i]:
            money += stock * A[i]
            stock = 0
    if stock>0:
        money += A[-1] * stock
    print(money)


if __name__ == '__main__':
    main()

