using System;
using System.Collections.Generic;


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

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

            Console.WriteLine(count);
        }
    }

    static class EnumerableExtension
    {
        public delegate void Function<in T>(T val);

        public static void ForEach<T>(this IEnumerable<T> enumerable, Function<T> function)
        {
            foreach (var x in enumerable)
            {
                function(x);
            }
        }
    }
}