use strict;
my $N=<>;
my $s = <>; chomp $s;
my @dat = split(/ /,$s);
my $a;
my $b;
my $shoji=1000;
for($a=0;$a<$N;$a++){
if($dat[$a]<$dat[$a+1]){($b=$shoji-(($shoji%$dat[$a]))/$dat[$a]);$shoji=$shoji%$dat[$a];}
elsif($dat[$a]>$dat[$a+1]){$shoji=$shoji+($b*$dat[$a]);$b=0;}}
print "$shoji";