import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    n = II()
    aa = MII()
    balance = 1000
    ss = []
    idxs = []
    minv = aa[0]
    minv_idx = 0
    for i in range(1, n):
        if minv > aa[i]:
            minv = aa[i]
            minv_idx = i
        elif minv < aa[i]:
            ss.append(minv)
            idxs.append(minv_idx)
            minv = 200
    if not idxs:
        print(1000)
        exit()
    idxs.append(n)
    for i in range(len(idxs)-1):
        buy = ss[i]
        sell = max(aa[idxs[i]:idxs[i+1]])
        num = balance // buy
        balance -= num * buy
        balance += sell * num
    print(balance)

if __name__ == '__main__':
    main()