using System;

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

            for (int i = 1; i < N; i++)
            {
                if (S[i] == '.' && S[i - 1] == '#')
                    count++;
            }

            Console.WriteLine(count);
        }
    }
}
