<?php
fscanf(STDIN, '%d', $n);
fscanf(STDIN, '%s', $s);


$white = 0; $black = 0;
for ($i = 0; $i < $n; $i++) {
    $current = substr($s, $i, 1);
    if ($current === '.') {
        $white++;
    } else {
        $black++;
    }
}
echo min($white, $black);
