$n = gets.chomp.to_i
$a = gets.chomp.split(" ").map(&:to_i)
$difference = [0]

def search_max(idx)
    i = idx+1
    max = 0
    max_idx = -1
    while $n > i && $difference[i] >= 0 do
        if $difference[i] > max then
            max = $difference[i]
            max_idx = i
        end
        i += 1
    end
    return max_idx
end

def search_min(idx)
    i = idx+1
    min = 0
    min_idx = -1
    while $n > i && $difference[i] < 0 do
        if $difference[i] < min then
            min = $difference[i]
            min_idx = i
        end
        i += 1
    end
    return min_idx
end

ans = 1000
have_stock = 0

($n-1).times do |i|
    $difference << $a[i+1] - $a[i]
end

idx = 0
flag = true

while $n > idx+1 do
    max_idx = search_max(idx)
    min_idx = search_min(idx)
    if max_idx != -1 then
        if flag then
            have_stock = ans / $a[idx]
            ans = ans % $a[idx]
            flag = false
        end
        idx = max_idx
        ans += have_stock * $a[idx]
        have_stock = 0
    elsif min_idx != -1 then
        idx = min_idx
        if search_max(idx) == -1 then
            break
        end
        have_stock = ans / $a[idx]
        ans = ans % $a[idx]
    else
        idx += 1
    end
end

puts ans