using System;
using System.Collections.Generic;
    class Program
    {
        static void Main(string[] args)
        {
            int input1 = int.Parse(Console.ReadLine());
            var input2 = Console.ReadLine();
            var output = "0";
            int flg = 0;
            int num = input2.IndexOf(".#");
            if(num < 0)
            {
                flg = 1;
                num = input2.IndexOf("#.");
            }
            var after = "";
            var before = "";
            int min = 0;
            int tmpnum = 0;

            while(flg == 0 && num >= 0)
            {
                before = input2.Substring(0, num + 1);
                after = input2.Substring(num + 1, input2.Length - (num + 1));
                tmpnum = before.Replace(".", "").Length + after.Replace("#", "").Length;
                if(tmpnum < min || min == 0)
                {
                    min = tmpnum;
                }
                if(flg == 0 && num < 0)
                {
                    flg = 1;
                }
                if(flg == 0)
                {
                    num = input2.IndexOf(".#", num + 1);
                }
                else
                {
                    num = input2.IndexOf("#.", num + 1);
                }
            }
            output = min.ToString(); 
            Console.WriteLine(output);

        }
    }