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++;
        
        while (now < N)
        {
            int white = 0, black = 0;
            while (now < N && S[now] == '#')
            {
                black++;now++;
            }
            while (now < N && S[now] == '.')
            {
                white++;now++;
            }
            ans += Math.Min(black, white);
        }
        
        Console.WriteLine(ans);
    }
}