using System;
using System.Linq;

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

            int count1 = 0;
            int count2 = 0;

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