def main():
    n = int(input())
    a = list(map(int,input().split()))
    b = a[0]
    u = 0
    data = []
    for i in range(n):
        if u==0 and a[i] > b:
            data.append(b)
            data.append(a[i])
            b = a[i]
            u = 1
        elif u==1 and a[i] < b:
            b = a[i]
            u = 0
    ans = 1000
    h = 0
    for i in range(len(data)):
        if i%2==0:
            h = ans//data[i]
            ans = ans - h*data[i]
        else:
            ans = ans + h * data[i]
            h = 0
    print(ans)

if __name__ == "__main__":
    main()
