<?php
  
$n = trim(fgets(STDIN));
$a = trim(fgets(STDIN));
$a = explode(' ', $a);

$money = 1000;
$kabu = 0;

foreach ($a as $i => $v) {
  $buy = $i < $n - 1 && $a[$i] < $a[$i + 1];
  if ($buy) {
    $add = floor($money / $a[$i]);
    $kabu += $add;
    $money -= $add * $a[$i];
  } else {
    $money += $kabu * $a[$i];
    $kabu = 0;
  }
}

echo $money;