using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Math;


namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        static void Main(string[] args)
        {
            int N = int.Parse(ReadLine());
            string s = ReadLine();
            int shiro = 0; int kuro = 0;int kuroans = 0; bool MaeKuro = false;
            for (int i = 0; i < N; i++)
            {
                string tmp = s[i].ToString();
                if (tmp == "#")
                {
                    MaeKuro = true;
                    kuro++;
                }
                else if (MaeKuro && tmp == ".")
                {
                    shiro++;
                    kuroans += kuro;kuro = 0;
                    MaeKuro = false;
                }
                else
                {
                    shiro++;
                }

            }
            WriteLine(
                Min(kuroans, shiro)
                );
        }
    }
}
