using System;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            int w = 0;
            int b = 0;
            for(int i = 0; i < n; i++)
            {
                if (s[i] == '.') w++;
                if (s[i] == '#') b++;
            }
            int ans = 0;
            if (w >= b)
            {
                ans = b;
                int cnt = n-1;
                while (s[cnt] == '#')
                {
                    ans--;
                    cnt--;
                }
            }else if (w < b)
            {
                ans = w;
                int cnt = 0;
                while (s[cnt] == '.')
                {
                    ans--;
                    cnt++;
                }
            }
            Console.WriteLine(ans);
        }
    }
}
