m = int(1000)
tmp = input()
a = list(map(int,input().split()))
s = 0
n = 0
for i in range(len(a)):
    if int(a[s]) < int(a[i]):
        m += (a[i] - a[s]) * (m // a[s])
        s = i
    else:
        continue
print(int(m))