using System;

namespace C___Stones
{
    class Program
    {
        static void Main (string[] args)
        {
            var n = int.Parse (Console.ReadLine ());
            var s = Console.ReadLine ();
            if (n == 1)
            {
                Console.WriteLine (0);
                return;
            }
            var count = 0;
            for (var i = 1; i < n; i++)
            {
                if (s[i - 1] == '#' && s[i] == '.')
                {
                    count++;
                }
            }
            Console.WriteLine (count);
        }
    }
}