n, *a = map(int, open(0).read().split())
a += 1,
m = 1000
from itertools import*
for i in [list(k) for p, k in groupby(range(n+1), key = lambda j:a[j] >= a[j-1]) if p]:
  m = m // a[i[0]] * a[i[-1]] + m % a[i[0]]
print(m)