n = int(input())
a = list(map(int, input().split()))
dp1 = [[0, 0] for i in range(n)]
dp2 = [[0, 0] for i in range(n)]
dp1[0]=[1000,0]
first = 1000//a[0]
dp2[0]=[1000-a[0]*first,first]

for i in range(1, n):
  temp = dp2[i-1][0]+dp2[i-1][1]*a[i]
  if temp>dp1[i-1][0]:
    dp1[i][0]=temp
  else:
    dp1[i][0]=dp1[i-1][0]
  temp = dp1[i-1][0]//a[i]
  if temp>dp2[i-1][1]:
    dp2[i][0]=dp1[i-1][0]-temp*a[i]
    dp2[i][1]=temp
  else: 
    dp2[i][0]=dp2[i-1][0]
    dp2[i][1]=dp2[i-1][1]
#print(dp1)
#print(dp2)
print(dp1[n-1][0])