import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    A=list(mi())

    if A[0] == max(A):
        print(1000)
        exit()

    pre = INF
    kabu = 0
    p = 1000
    for a in A:
        if pre > a:
            x = p//a
            p -= x*a
            kabu += x
        elif pre < a:
            p += a*kabu
            kabu = 0
        pre = a
    
    p += a*kabu
    print(p)





if __name__ == "__main__":
    main()