using System;
using System.Linq;

namespace VSC
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(System.Console.ReadLine());
            string S = System.Console.ReadLine();
 
            char[] str = S.ToCharArray();

            int K = 0;
            int white = S.Length;
            int black = 0;

              while(true){
                    white = Array.LastIndexOf(str,'.');
                    black = Array.IndexOf(str,'#');
                    if(white == -1 )break;
                    if(black == -1 )break;
                    if(black >= white)break;
                    str = str.Skip(black + 1).ToArray();
                    K++;

                    white = Array.LastIndexOf(str,'.');
                    if(white == -1 )break;
                    if(black >= white)break;
                    str = str.Take(str.Length - (white + 1)).ToArray();
                    K++;
              }
            System.Console.Write(K);
        }
    }
}