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

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

            var firstBlack = false;
            var black = 0;
            var white = 0;
            for (int i = 0; i < N; i++)
            {
                if (!firstBlack)
                {
                    if (S[i] == '#')
                    {
                        firstBlack = true;
                        black++;
                    }
                }
                else
                {
                    if (S[i] == '#')
                        black++;
                    else
                        white++;
                }
            }

            Console.WriteLine(Math.Min(black, white));
        }
    }
}