using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {  
            string n = Console.ReadLine();   
            string s = Console.ReadLine();  

            bool isSharp = false;
            int cnt = 0;

            for(int i=0;i < s.Length;i++)
            {
                if(s[i]== '#')
                {
                    isSharp=true;
                }
                else if(isSharp)
                {
                    cnt++;
                }
                else
                {
                    isSharp = false;
                }
            }

            Console.WriteLine(cnt);

        } 
    }
}
