using System;

namespace agc030_a
{
    class Program
    {
        static void Main(string[] args)
        {
            var textLength = Convert.ToInt32(Console.ReadLine());
            var text = Console.ReadLine();
            
            var count = 0;

            var prevString = text.Substring(0, 1);
            for(int i = 1; i < textLength; i++)
            {
                var subString = text.Substring(i, 1);

                if (subString == "." && prevString == "#"){
                    count++;
                    subString = "#";
                }

                prevString = subString;
            }

            var bcount = 0;

            prevString = text.Substring(textLength - 1, 1);
            for(int i = textLength - 2; i >= 0; i--)
            {
                var subString = text.Substring(i, 1);

                if (subString == "#" && prevString == "."){
                    bcount++;
                    subString = ".";
                }

                prevString = subString;
            }

            var ccount = 0;
            prevString = text.Substring(0, 1);
            for(int i = 1; i < textLength; i++)
            {
                var subString = text.Substring(i, 1);

                if (subString == "." && prevString == "#"){
                    ccount++;
                }

                prevString = subString;
            }

            var dcount = 0;
            prevString = text.Substring(textLength - 1, 1);
            for(int i = textLength - 2; i >= 0; i--)
            {
                var subString = text.Substring(i, 1);

                if (subString == "#" && prevString == "."){
                    dcount++;
                }

                prevString = subString;
            }

            count = Math.Min(count, bcount);
            count = Math.Min(count, ccount);
            count = Math.Min(count, dcount);
            Console.WriteLine(count.ToString());
        }
    }
}
