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;

        int firstBlackIndex = -1;
        for (int i = 0; i < N; i++)
        {
            if (S[i] == '#')
            {
                firstBlackIndex = i;
                break;
            }
        }

        if (0 <= firstBlackIndex && firstBlackIndex + 1 < N)
        {
            S = S.Substring(firstBlackIndex);
            int res = S.Length - S.Replace(".", "").Length;
            Console.WriteLine(res);
        }
        else
        {
            Console.WriteLine(0);
        }

        

    }
}