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;
my @e = ();
if ($index >= 0) {
    for (my $i=$index; $i<=$rindex; $i++) {
	$c++ if substr($s, $i, 1) eq '.';
    }
    $d = $rindex-$index+1-$c;
    push @e, $c, $d;
    my $f = 0; my $g = 0; my $last = '.';
    for (my $i=$index; $i<=$rindex; $i++) {
	if (substr($s, $i, 1) eq '.') {
	    $f++;
	} else {
	    $g++;
	    if ($last eq '.') {
		push @e, $f+$d-$g;
	    }
	}
	$last = substr($s, $i, 1);
    }
}
print min(@e), "\n";
