# coding: utf-8


def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))
    budget = 1000
    stock = 0
    temp = 0

    for i in range(n-1):
        if A[i] < A[i+1] and A[i] <= temp+budget:
            budget += temp
            temp = 0
            stock = budget//A[i]
            budget %= A[i]
        elif A[i+1] < A[i]:
            temp = max(temp, A[i]*stock)

    return str(A[-1]*stock+budget+temp)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
