n = int(input())
a = list(map(int,input().split()))
x = 1000
b = 0
for i in range(n):
  if i == 0:
    if a[i] == max(a):
      print(x)
      exit()
    else:
      if a[i]<a[i+1]:
        b += x//a[i]
        x -= a[i]*(x//a[i])
  else:
    if a[i] == max(a):
      x += a[i]*b
      if x>= 1000:
        print(x)
        exit()
      else:
        print(1000)
        exit()
    else:
      if a[i]>a[i+1]:
        x += b*a[i]
        b = 0
      elif a[i]<a[i+1]:
        b += x//a[i]
        x -= (x//a[i])*a[i]
      elif a[i]==a[i+1]:
        pass
      elif a[i] == min(a):
        b += x//a[i]
        x -= a[i]*(x//a[i])