using System;
using System.Linq;

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

            var ans = int.MaxValue;
            var lb = 0;
            var lw = 0;
            var rb = S.Where(x => x == '#').Count();
            var rw = S.Length - rb;

            if (rb + lb == 0 || lw + rw == 0)
            {
                Console.WriteLine(0);
                return;
            }

            for (int i = 0; i < S.Length; i++)
            {
                if (S[i] == '.')
                {
                    lw++;
                    rw--;
                }
                else
                {
                    ans = Math.Min(ans, lb + rw);

                    lb++;
                    rb--;
                }
            }

            Console.WriteLine(ans);
        }
    }
}

