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());
            var s = ReadLine();

            int ans = int.MaxValue;
            //iが境界線,iより左が全部".",右は"#"
            for (int i = 0; i < N; i++)
            {
                int tmp = 0;
                for (int j = 0; j < N; j++)
                {
                    if (j<=i && s[j] == '#')
                    {
                        tmp++;
                    }
                    if (j>i && s[j] == '.')
                    {
                        tmp++;
                    }
                }
                ans = Min(ans, tmp);
            }
            WriteLine(ans);
        }
    }
}
