N = int(input())
 
A = list(map(int,input().split()))
 
a = 0
b = 0
Money = 1000
 
for i in A:
  if a == 0:
    a = i
    continue
  if b <= i:
    b = i
    continue
  else:
    if a < b:
      Money = Money // a * b + Money % a
    a = b = i
    
if a < b:
      Money = Money // a * b + Money % a
print(Money)