n = int(input())
a = list(map(int, input().split()))

flag = [-1]*n
t = 1
for i in range(n-1, -1, -1):
  if t == 1:
    if a[i-1] < a[i]:
      flag[i] = t
      t = 0
  else:
    if a[i] < a[i-1]:
      flag[i] = t
      t = 1
    
t = 0
s = 0
ans = 1000
for i in range(n):
  if flag[i] == 0:
    t = 1-t
    s = ans//a[i]
    ans %= a[i]
  elif flag[i] == 1:
    t = 1-t
    ans += s*a[i]
    s = 0
print(ans)