using System;
using System.Collections.Generic;
using System.Linq;

namespace TenkaPBC2019C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());//石の数Ｎ個
            string S = Console.ReadLine();//文字列　．白　＃黒
            List<int> ans_List = new List<int>();
            int counter0 = 0;
            int counter1 = 0;
            for (int i = 0; i <= N; i++)
            {
                  counter0= S.Substring(0, i).Length - S.Substring(0, i).Replace("#", "").Length;
                  counter1= S.Substring(i, N-i).Length - S.Substring(i, N - i).Replace(".", "").Length;
                ans_List.Add(counter0+counter1);
            }
            Console.WriteLine(ans_List.Min());
        }
    }
}
