days= int(input())
word = input().split()
nums = [0]*days
for i in range(days):
    nums[i] = int(word[i])
yen = 1000
kabu = 0

maxs = []
mins = []
if nums[0] < nums[1]:
    mins.append(0)
    
for j in range(1,days-1):
    if nums[j] < nums[j+1] and nums[j] <= nums[j-1]:
        mins.append(j)
    elif nums[j] > nums[j+1] and nums[j] >= nums[j-1]:
        maxs.append(j)
        
if nums[days-2] < nums[days-1]:
    maxs.append(days-1)

if len(maxs) == 0:
    print(1000)
elif len(maxs) == 1:
    kabu = yen // nums[mins[0]]
    yen = yen % nums[mins[0]]
    yen += kabu * nums[maxs[0]]
    print(yen)
else:
    kabu = yen // nums[mins[0]]
    yen = yen % nums[mins[0]]
    for s in range(len(maxs)-1):
        yen += kabu * nums[maxs[s]]
        kabu = yen // nums[mins[s+1]]
        yen = yen % nums[mins[s+1]]
    yen += kabu * nums[maxs[s+1]]
    print(yen)