using System;
using System.Linq;

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

            string w_arr, b_arr;
            int cost = 0, min = int.MaxValue;

            for (int i = 0; i <= N; i++)
            {
                w_arr = S.Substring(0, i);
                b_arr = S.Substring(i);

                cost = w_arr.Count(x => x == '#') + b_arr.Count(x => x == '.');
                min = Math.Min(min, cost);
            }

            Console.WriteLine(min);
        }
    }
}
