using System;

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

        bool foundBlack = false;
        int count = 0;
        for (int i = 0; i < N; i++)
        {
            if (foundBlack && S[i] == '.')
            {
                count++;
            }
            else if (S[i] == '#' && !foundBlack)
            {
                foundBlack = true;
            }
        }

        Console.WriteLine(count);

    }
}