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

namespace ConsoleApp6
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            char[] S = Console.ReadLine().ToArray();
            int plaseDT = Array.IndexOf(S, '.');
            int plaseCH = Array.IndexOf(S, '#');
            int newaryL1 = S.Length - plaseCH;
            int newaryL2 = S.Length - plaseDT;
            char[] newary1 = new char[newaryL1];
            char[] newary2 = new char[newaryL2];
            if (plaseCH == -1)
            {
                Console.WriteLine('0');
            }
            else
            {
                Array.Copy(S, plaseCH, newary1, 0, newaryL1);
                int ans1 = newary1.Count(n => n == '.');
                Array.Copy(S, plaseDT, newary2, 0, newaryL2);
                int ans2 = newary2.Count(n => n == '#');
                //Console.WriteLine(plaseCH);
                //Console.WriteLine(ans1);
                //Console.WriteLine(ans2);
                Console.WriteLine(Math.Min(ans1,ans2));
            }


            //System.Threading.Thread.Sleep(1000);

        }
    }
}