n = int(input())
a = list(map(int, input().split()))
a_cur = a[0]

m = 1000
s = 0

for i in range(1, n):
  a_next = a[i]
  if a_cur < a_next:
    # buy current and sell next
    s = m // a_cur
    m += s * (a_next - a_cur)
    a_cur = a_next
if s > 0:
  m += s * a[-1]
print(m)