#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let n = read::<usize>();
    let mut a = read_vec::<i64>();
    a.dedup();
    let n = a.len();

    let mut points = vec![];
    let mut increasing = false;
    if a[0] < a[1] {
        increasing = true;
        points.push(0);
    }
    for i in 1..n - 1 {
        if increasing {
            if a[i] > a[i + 1] {
                points.push(i);
                increasing = false;
            }
        } else {
            if a[i] < a[i + 1] {
                points.push(i);
                increasing = true;
            }
        }
    }
    if a[n - 2] < a[n - 1] {
        points.push(n - 1);
        increasing = true;
    }
    if !increasing {
        points.pop();
    }
    debug!(points);

    let mut cur_money = 1000;
    let mut cur_stock = 0;
    assert!(points.len() % 2 == 0);
    for i in 0..points.len() / 2 {
        cur_stock += cur_money / a[points[2 * i]];
        cur_money %= a[points[2 * i]];
        cur_money += cur_stock * a[points[2 * i + 1]];
        cur_stock = 0;
    }
    println!("{}", cur_money);
}

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
