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

namespace TenkaBeginner2019C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();
            S += "#";

            int ans = int.MaxValue;
            for (int k = 0; k <= N; k++)
            {
                int countW = CountChar(S.Substring(0, k).ToString(), '#');
                int countB = CountChar(S.Substring(k).ToString(), '.');
                int countSum = countW + countB;

                if (ans > countSum) ans = countSum;
            }

            Console.WriteLine(ans);
            Console.ReadKey();
        }

        static int CountChar(string s, char c)
        {
            return s.Length - s.Replace(c.ToString(), "").Length;
        }
    }
}
