<?php
$n = trim(fgets(STDIN));  
$str = trim(fgets(STDIN));

$beforeCount = substr_count($str, '#.');
if ($beforeCount === 0 ) {
	echo 0, PHP_EOL;
  	exit();
}

$strs = str_split($str);

//black to white
$bToWCount = 0;
for ($i = 0; $i < $n - 1; $i++) {
	if($strs[$i] === '#') {
    	$bToWCount++;
    }
}

//white to black
$wToBCount = 0;
for ($i = 0; $i < $n; $i++) {
	if($strs[$i] === '.') {
    	$wToBCount++;
    }
}

echo min($bToWCount, $wToBCount), PHP_EOL;