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

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:usize = read();
    let a:Vec<u64> = (0..n).map(|_| read()).collect();
    let tilt:Vec<i64> = a[..].windows(2).map(|x|{
        if x[0] == x[1]{
            0
        }else if  x[0] < x[1]{
            1
        }else{
            -1
        }
    }).collect();

    let mut pre = 0;
    let mut money = 1000;
    let mut stock = 0;
    for i in 0..tilt.len(){
        if pre == 1 && tilt[i] == -1{
            money += stock * a[i];
            stock = 0;
        }else if pre == 0 && tilt[i] == 1{
            stock = money/a[i];
            money = money%a[i];
        }else if pre == 0 && tilt[i] == -1{
            money += stock * a[i];
            stock = 0;
        }else if pre == -1 && tilt[i] == 1{
            stock = money/a[i];
            money = money%a[i];
        }
        pre = tilt[i];
    }
    //println!("{:?}",tilt);
    money += stock * a[n-1];
    println!("{}",money);
}
