using System;
using System.Linq;

namespace AtCoder2
{
    class Program
    {
        static void Main(string[] args)
        {
            checked
            {
                Console.ReadLine();
                var s = Console.ReadLine();

                var white = s.Select(c => c == '.' ? 1 : 0).ToList();

                {
                    var sum = 0;
                    for (int n = white.Count - 1; n >= 0; n--)
                    {
                        sum += white[n];
                        white[n] = sum;
                    }
                }

                var black = s.Select(c => c == '#' ? 1 : 0).ToList();

                {
                    var sum = 0;
                    for (int n = 0; n < black.Count; n++)
                    {
                        sum += black[n];
                        black[n] = sum;
                    }
                }

                white.RemoveAt(0);
                white.Add(0);
                var res = white.Zip(black, (w, b) => w + b).Min();

                Console.WriteLine(res);
            }
        }
    }
}
