using System;
using System.Linq;

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

            long count1 = 0;
            long count2 = 0;
            int flag = 0;

            for (var i = 0; i < N; i++)
            {
                if(flag == 0)
                {
                    if(S[i] == '#')
                    {
                        flag = 1;
                        count1++;
                    }
                }
                else
                {
                    if(S[i] == '#')
                    {
                        count1++;
                    }
                    else
                    {
                        count2++;
                    }
                }
            }
            
            if(S[N-1] == '#')
            {
                count1--;
            }

            if(count1 >= count2)
            {
                Console.WriteLine(count2);
            }
            else
            {
                Console.WriteLine(count1);
            }
        }
    }
}
