use List::Util qw(max min sum);
my ($n) = split(/\s+/, <>);
my ($s) = split(/\s+/, <>);

my $index = index($s, '#');
my $rindex = rindex($s, '.');
my $c = 0;
my $d = 0;
if ($index >= 0) {
    for (my $i=$index; $i<=$rindex; $i++) {
	$c++ if substr($s, $i, 1) eq '.';
	$d++ if substr($s, $i, 1) eq '#';
    }
}
print min($c, $d), "\n";
