using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Tenka1._2019Beginner
{
    class C
    {
        static void Solve()
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();
            
            //初期配置の最も右の白の位置を取得
            int r = s.Length-1;
            while (r >= 0 && s[r] == '#')
                r--;

            //初期配置の最も左の黒の位置を取得
            int l = 0;
            while (l < s.Length && s[l] == '.')
                l++;

            if (r < 0 || l == s.Length)
            {
                Console.WriteLine(0);
                return;
            }

            int bc = 0;
            for(int i = 0; i < r; i++)
            {
                if (s[i] == '#')
                    bc++;
            }

            int wc = 0;
            for(int i = l; i < s.Length; i++)
            {
                if (s[i] == '.')
                    wc++;
            }

            Console.WriteLine(bc < wc ? bc : wc);
        }

        static void Main(string[] args)
        {
            Solve();
        }
    }
}
