using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;
using static System.Math;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = ReadInt();
            var s = Read();

            var black = CountChar(s, "#");
            var white = CountChar(s, ".");

            if (black == n || white == n)
            {
                WriteLine(0);
                return;
            }

            var a1 = s.IndexOf("#");
            //WriteLine(a1);
            var s1 = s.Substring(a1,n-a1);
            s = s1;


            if (CountChar(s, "#") > CountChar(s, "."))
            {
                var a = s.IndexOf("#");
                WriteLine((s.Length - s.Replace(".", "").Length) - a);
            }
            else
            {
                var a = s.LastIndexOf(".");
                WriteLine((s.Length - s.Replace("#", "").Length) - (a - s.Length + 2));
            }
        }
        public static int CountChar(string s, string c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }

        private static string Read() { return ReadLine(); }
        private static string[] Reads() { return (Read().Split()); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}
