<?php

fscanf(STDIN, "%d", $N);
$S = str_split(trim(fgets(STDIN)));

# 全部黒にする場合
$count_black = 0;
for ( $i = 0 ;$i < $N ;$i++ ) {
    if ($S[$i] == '.') {
        $count_black++;
    }
}

# 全部白にする場合
$count_white = count($S) - $count_black;

# 最初の黒以降を全て変更
$index_first_black = 0;
for ( $i = 0 ;$i < $N ;$i++ ) {
    if ($S[$i] == '.') {
        $index_first_black++;
    } else {
        break;
    }
}

# 最初の黒以降を全て黒に変更
$change_black = 100000000;
if ($index_first_black > 0) {
    $change_black = $count_black - $index_first_black;
}

echo min([$count_black, $count_white, $change_black]);
