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 topbnum = input2.IndexOf("#");
            int lastwnum = input2.LastIndexOf(".");
            if (topbnum >= 0 && lastwnum >= 0)
            {
                var mid = input2.Substring(topbnum, lastwnum - topbnum + 1);
                int midwnum = mid.Replace("#", "").Length;
                int midbnum = mid.Replace(".", "").Length;


                if (midbnum > midwnum)
                {
                    output = midwnum.ToString();
                }
                else
                {
                    output = midbnum.ToString();
                }
            }
            Console.WriteLine(output);

            Console.ReadLine();
        }
    }