using System;
using System.Collections.Generic;
using System.Linq;

class MainClass
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();

        int now = 0;
        int ans = 0;
        while (now < N && S[now] == '.') now++;
        int white = 0, black = 0;
        while (now < N)
        {
            if (S[now] == '.') white++;
            else black++;
            now++;
        }
        ans = Math.Min(black, white);
        Console.WriteLine(ans);
    }
}