my $number = @genbank_na_acc;
print $number."\n";

my $min = 0;
my $max = 500;

my $factory;
my @subarray;

while ($min < $number){

	if ($max < $number){ 
	@subarray = @genbank_na_acc[$min,$max];
	}
	else{
	@subarray = @genbank_na_acc[$min, $number-1];
	}


$factory = Bio::DB::EUtilities-> new(-eutil => 'esearch',
						-email => 'pat.boutet@gmail.com',
						-db => 'nucleotide',
						-term => join(',', @subarray),
						-usehistory => 'y');
$min += $max;
$max += $max; 
}

my $count = $factory -> get_count;
print $count."\n";

exit;