use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.trim().parse().ok().unwrap()
}

fn input_vec() -> Vec<u64> {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
    let n: usize = input();
    let a_vec = input_vec();
    let mut money = 1000;
    let mut stock = 0;
    if a_vec[0] < a_vec[1] {
        stock = money / a_vec[0];
        money -= (money / a_vec[0]) * a_vec[0];
    }
    for i in 1..n-1 {
        // if a_vec[i - 1] <= a_vec[i] && a_vec[i] > a_vec[i+1] {
        if a_vec[i] > a_vec[i+1] {
            // 売り
            money += stock * a_vec[i];
            stock = 0;
        }
        // if a_vec[i - 1] >= a_vec[i] && a_vec[i] < a_vec[i+1] {
        if a_vec[i] < a_vec[i+1] {
            // 買い
            stock = money / a_vec[i];
            money -= (money / a_vec[i]) * a_vec[i];
        }
    }
    money += stock * a_vec[n-1];
    println!("{}", money);
}
