using System;

namespace C___Stones
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var S = Console.ReadLine().ToCharArray();
            int count = 0;

            for (int i = 0; i < N - 1; i++)
            {
                if (S[i] == '#' && S[i + 1] == '.')
                {
                    int b = i, w = i + 1;
                    int black = 0, white = 0;

                    while (b >= 0 && S[b] == '#')
                    {
                        b--;
                        black++;
                    }

                    while (w < N && S[w] == '.')
                    {
                        w++;
                        white++;
                    }

                    count += Math.Min(black, white);
                }
            }
            Console.WriteLine(count);
        }
    }
}
