using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{

    static void Main(string[] args)
    {
        ProblemC();
    }
	static void ProblemC()
    {
        System.Console.ReadLine();//N
        bool[] S = System.Console.ReadLine().Select(
            (c) => {
                if(c == '#')
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }).ToArray();

        bool firstFound = false;
        int countB = 0;
        int countWAfterB = 0;
        int lastW = 0;
        for (int i = 0; i < S.Length; i++)
        {
            if (S[i])
            {
                countB++;
                if (!firstFound)
                {
                    firstFound = true;
                }
            }
            else
            {
                if (firstFound) 
                { 
                    countWAfterB++;
                }
                lastW = i;
            }
        }

        int turnB = countB - (S.Length - (lastW+1));
        int ans = 0;
        if (!firstFound)
        {
            // 黒なし
            ans = 0;
        }
        else if (countWAfterB < turnB) 
        {
            ans = countWAfterB;
        }
        else
        {
            ans = turnB;
        }
        System.Console.WriteLine(ans.ToString());

    }
}