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 l = 0;
    ulong r = N;
    while (l < N && S[l] == '.') l++;
    while (r > 0 && S[r - 1] == '#') r--;

    int cnt = 0;
    while (l < r){
        ulong nl = l + 1;
        ulong nr = r - 1;
        while (nl < N && S[nl] == '.') nl++;
        while (nr > 0 && S[nr - 1] == '#') nr--;

        if (nl - l > r - nr) l = nl;
        else r = nr;

        cnt++;
    }

    writeln(cnt);
}

