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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {  
            string n = Console.ReadLine();   
            string s = Console.ReadLine();  

            bool isSharp = false;
            bool isSharpForWhite = false;
            int cnt = 0;
            int cntForWhite = 0;

            for(int i=0;i < s.Length;i++)
            {
                if(s[i] == '#')
                {
                    isSharp=true;
                    isSharpForWhite=true;
                }
                else 
                {
                    if(isSharpForWhite)
                    {
                        cntForWhite++;
                        isSharpForWhite=false;
                    }

                    if(isSharp)
                    {
                        cnt++;
                    }
                    else
                    {
                        isSharp = false;
                    }
                }
            }

            Console.WriteLine(Math.Min(cnt, cntForWhite));

        } 
    }
}
