n = int(input())
a = list(map(int, (input().split())))
a.append(0)
mon = 1000
kab = 0
x = 0
z = 0
while z <= n-1:
    if x == 0:
        while a[z+1] < a[z]:
            z += 1
            if z == n-1:
                break
        kab += mon//a[z]
        ans = mon
        mon -= kab*a[z]
        x = 1
        if z < n-1:
            z += 1
        else:
            break
    elif x == 1:
        while a[z+1] > a[z]:
            z += 1
            if z == n-1:
                break
        mon += kab*a[z]
        kab = 0
        x = 0
        if z < n-1:
            z += 1
        else:
            break
print(max(ans, mon))