ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

n = ni()
a = nl()

ans = 0
for i in range(2**n):
  mo = 1000
  st = 0
  for j in range(n):
    if ((i>>j) & 1):
      s = mo//a[j]
      st += s
      mo -=a[j]*s
    else:
      mo+=st*a[j]
      st = 0
  ans = max(ans, mo)
print(ans) 
