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

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