using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            char[] c = Console.ReadLine().ToCharArray();

            if(N == 1)
            {
                Console.WriteLine("0");
                return;
            }

            int[] white = new int[N];

            if (c[0] == '.')
                white[0] = 1;
            else
                white[0] = 0;

            for(int i=1;i<N;i++)
            {
                if (c[i] == '.')
                    white[i] = white[i - 1] + 1;
                else
                    white[i] = white[i - 1];
            }

            int allw = white[N - 1];
            int ans = int.MaxValue;

            for(int i=0;i<N;i++)
            {
                int temp = i + 1 + allw - white[i] * 2;
                if (ans > temp)
                    ans = temp;
            }


            Console.WriteLine(ans.ToString());
        }
    }
}
