#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    unused_imports,
    dead_code
)]
//use proconio::fastout;
use proconio::input;
use proconio::marker::*;
//use std::collections::HashSet;
// use std::cmp::*;
use std::collections::*;

fn main() {
    input! {
       N:usize,
       A:[i32;N]
    }
    let mut money = 1000;
    let mut stock = 0;
    if A[0] < A[1] {
        stock = money / A[0];
        money = money % A[0];
    }
    for i in 1..N - 1 {
        if A[i] < A[i + 1] {
            // buy
            stock += money / A[i];
            money = money % A[i];
        } else if A[i] > A[i + 1] {
            // sell
            money += stock * A[i];
            stock = 0;
        }
    }
    money += stock * A[N - 1];
    println!("{}", money);
}
