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 ~ "#";

    int switch_i = 0;
    while (S[switch_i] == '.') switch_i++;
    int cnt = 0;
    foreach (i; switch_i..(N + 2)) if (S[i] == '.') cnt++;

    int ans = cnt;
    int cnt0 = 0;
    int cnt1 = 0;
    foreach (i; switch_i..(N + 1)){
        if (S[i] == '.') cnt0++;
        else cnt1++;

        if (S[i] == '.' && S[i + 1] == '#'){
            cnt = cnt + cnt1 - cnt0;
            if (cnt < ans) ans = cnt;

            cnt0 = 0;
            cnt1 = 0;
        }
    }

    writeln(ans);
}

