using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace tenka1_2019_c
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = decimal.Parse(Console.ReadLine());
            var S = Console.ReadLine();
            int b = 0;
            int w = 0;

            var fb = S.IndexOf("#");

            if (fb < 0)
                //全白
                Console.WriteLine(0);
            else
            {
                //初出の黒以降にある色をカウント
                for (int i = fb; i < N; i++)
                    if (S[i] == '#')
                        b++;
                    else
                        w++;

                Console.WriteLine(Math.Min(b, w));

            }
          
        }
    }
}
