import std.stdio;
import std.string;
import std.conv;
import std.array;

void main()
{
    ulong N = readln.split[0].to!ulong;
    char[] S = readln.chomp.to!(char[]);

    ulong first_i = 0;
    while (first_i < N && S[first_i] == '.') first_i++;

    ulong last_i = N;
    while (last_i > 0 && S[last_i - 1] == '#') last_i--;

    int cnt = 0;
    if (first_i < last_i) {
        foreach (i; first_i..last_i) if (S[i] == '.') cnt++;
    }

    ulong len = last_i - first_i;

    writeln((cnt < len - cnt) ? cnt : (len - cnt));
}

