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

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

    S = "." ~ S ~ "#";

    ulong[] switch_i;
    foreach (i; 1..(N + 2)){
        if (S[i - 1] == '.' && S[i] == '#') switch_i ~= i;
    }

    ulong ans = N;
    foreach (i; switch_i){
        int cnt = 0;
        foreach (j; 0..i) if (S[j] == '#') cnt++;
        foreach (j; i..(N + 2)) if (S[j] == '.') cnt++;

        if (cnt < ans) ans = cnt;
    }

    writeln(ans);
}

