mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = list(map(int, input().split()))
    M = 1000
    S = 0
    A.append(0)

    for i in range(N):
        if A[i] < A[i+1]:
            S = M // A[i]
            M -= S * A[i]
        elif A[i] > A[i+1]:
            M += S * A[i]
            S = 0
    print(M)


if __name__ == '__main__':
    main()
