using System;
using System.Linq;

namespace AtCoder2
{
    class Program
    {
        public static void Main(string[] args)
        {
            checked
            {
                var len = int.Parse(Console.ReadLine());
                var s = Console.ReadLine();
                s = s.Substring(0, len);

                int toBlack = int.MaxValue;
                {
                    var start = s.IndexOf("#.");

                    if (start != -1)
                    {
                        var s2 = s.Substring(start);
                        toBlack = s2.Count(c => c == '.');
                    }
                }

                int toWhite = int.MaxValue;
                {
                    var start = s.LastIndexOf("#.");
                    if (start != -1)
                    {
                        var s2 = s.Substring(0, start + 1);
                        toWhite = s2.Count(c => c == '#');
                    }
                }

                var res = Math.Min(toBlack, toWhite);
                Console.WriteLine((res == int.MaxValue) ? 0 : res);
                Console.Out.Flush();
            }
        }
    }
}
