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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int m = int.Parse(Console.ReadLine());
            List<char> str = Console.ReadLine().ToList<char>();

            int b = str.Count(x => x == '.');
            int w = str.Count(x => x == '#');

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


            //.が白#が黒
            //クロのすぐ右に城が来ないようにしたい


        }
        
    }
}
