#!/usr/bin/env python
# coding: utf-8

# In[10]:


N = int(input())
A = list(map(int, input().split()))


# In[11]:


mylist = []
s = 0
m = 1000
ans = m
for i in range(1,N):
    if A[i] > A[i-1]:
        mylist.append(1)
    elif A[i] < A[i-1]:
        mylist.append(-1)
    else:
        mylist.append(0)
for j,x in enumerate(mylist):
    if x > 0:
        s = m//A[j]
        m = m - s*A[j]
    elif x < 0:
        m = s*A[j]
        s = 0
    ans = max(ans, m+s*A[j])
ans = max(ans, m+s*A[-1])
print(ans)


# In[ ]:




