<?php

fscanf(STDIN, "%d", $N);
fscanf(STDIN, "%s", $S);
$ch = str_split($S);
$total_w = 0;
$total_b = 0;
$arr = [];
$min = 20010;
$now;
for ($i=0; $i < $N; $i++) { 

	$now = $ch[$i];
	if ($now == '.') {
		$total_w++;
	}else{
		$total_b++;
	}
	$arr[$i][0]=$total_w;
	$arr[$i][1]=$total_b;
}

for ($j=0; $j < $N; $j++) { 
	$cal = $total_w - $arr[$j][0] + $arr[$j][1];
	if ($min > $cal) {
		$min = $cal;
	}
}

$ans = min($min, $total_w, $total_b);
printf("%d", $ans);