  let mut buf = String::new();
  std::io::stdin().read_line(&mut buf).unwrap();
  return buf
    .split_whitespace()
    .map(|word| String::from(word))
    .collect();
}

fn main() {
  let inputs = input_line();
  let n: usize = inputs[0].parse().unwrap();
  let inputs = input_line();
  let mut a: Vec<i64> = Vec::new();
  for i in 0..n {
    a.push(inputs[i].parse().unwrap());
  }

  let mut tops: Vec<usize> = Vec::new();
  for i in 1..(n - 1) {
    if a[i - 1] < a[i] && a[i + 1] <= a[i] {
      tops.push(i);
    }
  }
  if a[n - 2] < a[n - 1] {
    tops.push(n - 1);
  }

  let mut bottoms: Vec<usize> = Vec::new();
  for i in 0..tops.len() {
    let mut bottom = 200;
    let mut bottom_i: usize = 0;
    let left = if i == 0 {
      0
    } else {
      tops[i - 1]
    };
    for j in left..tops[i] {
      if a[j] < bottom {
        bottom = a[j];
        bottom_i = j;
      }
    }
    bottoms.push(bottom_i);
  }

  let mut money: i64 = 1000;
  for i in 0..bottoms.len() {
    let buy_value = a[bottoms[i]];
    let stock = money / buy_value;
    money -= buy_value * stock;
    let sell_value = a[tops[i]];
    money += sell_value * stock;
  }

  println!("{}", money);
}
