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();
            var S_rev = string.Join("", S.Reverse());

            int[] w_arr = new int[N + 1], b_arr = new int[N + 1];
            int cost = 0, min = int.MaxValue;

            for (int i = 0; i <= N; i++)
            {
                if (i == 0)
                {
                    w_arr[i] = 0;
                    b_arr[i] = 0;
                    continue;
                }

                w_arr[i] = S[i - 1] == '#' ? ++w_arr[i - 1] : w_arr[i - 1];
                b_arr[i] = S_rev[i - 1] == '.' ? ++b_arr[i - 1] : b_arr[i - 1];
            }

            for (int i = 0; i <= N; i++)
            {
                cost = w_arr[i] + b_arr[N - i];
                min = Math.Min(min, cost);
            }

            Console.WriteLine(min);
        }
    }
}
