def main():
    import sys
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    N = int(input())
    A = [int(x) for x in input().strip().split()]
    i = 0
    stock = 0
    cash = 1000
    while i+1 < N:
        if A[i] < A[i+1]:
            stock += cash // A[i]
            cash -= stock * A[i]
            # print('buy {} at {} yen'.format(stock, A[i]))
        elif A[i] > A[i+1]:
            cash += stock * A[i]
            # print('buy {} at {} yen, total cash {}'.format(stock, A[i], cash))
            stock = 0
        i += 1
    else:
        cash += stock * A[-1]
    print(cash)

if __name__ == '__main__':
    main()