from collections import deque
n = int(input())
a = list(map(int,input().split()))
stack = deque()
stack.append([1000,0,0,200])
ans = []
while stack:
  money,kabu,i,temp = stack.pop()
  ans.append(money)
  if i==n:
    break
  stack.append([money,kabu,i+1,temp])
  if a[i]<temp and a[i]<=money:
    kabu += money//a[i]
    money %= a[i]
  elif a[i]>temp and kabu>=1:
    money += a[i]*kabu
    kabu = 0
  stack.append([money,kabu,i+1,a[i]])
  ans.append(money)
print(max(ans))