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();
            //先頭白を取り除く
            for (int i = 0; i < N; i++)
            {
                if (s[i] == '#')
                {
                    s = s.Substring(i, N-i);
                    break;
                }
            }
            //後方黒を取り除く
            for (int i = s.Length-1 ; 0 < i; i--)
            {
                if (s[i] == '.')
                {
                    s = s.Substring(0, i+1);
                    break;
                }
            }
            //白と黒数える
            int kuro = 0; int shiro = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == '.')
                {
                    shiro++;
                }
                else
                {
                    kuro++;
                }
            }
            WriteLine(
                Min(kuro,shiro)
                );
        }
    }
}
