macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main(){

    input!{
        n: usize,
        a: [usize;n],
    }
    let mut max_value = a[0];
    let mut max_index = 0;
    for i in 0..n {
        if max_value < a[i] {
            max_index = i;
        } 
    }
    
    if max_index==0{
        println!("1000");
        return;
    }

    let mut min_value = a[0];
    let mut min_index = 0;
    for i in 0..max_index+1 {
        if a[i] < min_value {
            min_index = i;
        }
    }
    
    let mut num_kabu = 0;
    let mut money = 1000;
    let mut i_tmp = 0;
    for i in 1..max_index+1 {
        if a[i] < a[i_tmp] {
            if money<a[i]*num_kabu {
                continue; 
            } else{
                //println!("{}", num_kabu);
                num_kabu += money/a[i];
                money -= a[i]*num_kabu;
            }
        } else if a[i_tmp] < a[i] {
            if num_kabu==0 {
                continue;
            } else {
                money += a[i]*num_kabu;
                num_kabu = 0;
            }
        }
        i_tmp = i;
        // println!("{}", i); 
        // println!("{}", num_kabu);
        // println!("{}", money);
    }

    println!("{}", money);

}