n = int(input())
a = list(map(int, input().split()))
ans = 1000
stock = 0
for i, num in enumerate(a):
  if i == n-1:
    ans += stock*num
  else:  
    if num > a[i+1]:
      ans += stock*num
      stock = 0
    elif num < a[i+1]:
      stock = ans//num
      ans %= num
print(ans)