terms = int(input())
values = [int(i) for i in input().split(" ")]

newValues = []
tempValue = 0
trend = ""

for i in range(terms):
    if i == 0:
        newValues.append(values[i])
        tempValue = values[i]
    elif i == terms - 1:
        if (trend == "U" and tempValue > values[i]) or (trend == "D" and tempValue < values[i]):
            newValues.append(tempValue)
            newValues.append(values[i])
        elif (trend == "U" or trend == "") and tempValue < values[i]:
            newValues.append(values[i])
    elif trend == "":
        if tempValue > values[i]:
            tempValue = values[i]
            trend = "D"
        elif tempValue < values[i]:
            tempValue = values[i]
            trend = "U"
    else:
        if trend == "U" and tempValue > values[i]:
            newValues.append(tempValue)
            tempValue = values[i]
            trend = "D"
        elif trend == "D" and tempValue < values[i]:
            newValues.append(tempValue)
            tempValue = values[i]
            trend = "U"
        elif trend == "D" and tempValue >= values[i]:
            tempValue = values[i]
        elif trend == "U" and tempValue <= values[i]:
            tempValue = values[i]

baseWealth = [1000,0]

for i in range(len(newValues) - 1):
    if newValues[i] < newValues[i+1]:
        baseWealth[1] = baseWealth[0] // newValues[i]
        baseWealth[0] = baseWealth[0] % newValues[i]
    else:
        baseWealth[0] = baseWealth[0] + baseWealth[1] * newValues[i]
        baseWealth[1] = 0
baseWealth[0] = baseWealth[0] + baseWealth[1] * newValues[len(newValues) - 1]
baseWealth[1] = 0

print(baseWealth[0])
