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

namespace ConsoleApp5
{

    class Program
    {
        static void Main(string[] args)
        {

            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();
            int WP = N + 1;
            int BP = -1;


            for (int i = 0; i < N; i++)
            {
                if (S[i] == '.' && i < WP)
                {
                    WP = i;
                }
                else if (S[i] == '#' && i > BP)
                {
                    BP = i;
                }

            }

            int resW = 0;
            int resB = 0;

            for (int i = 0; i <= BP; i++)
            {
                if (S[i] == '#')
                {
                    resB++;
                }
            }
            for (int i = N - 1; i >= WP; i--)
            {
                if (S[i] == '.')
                {
                    resW++;
                }
            }

            if (resW >= resB)
            {
                Console.WriteLine(resB);
            }
            else
            {
                Console.WriteLine(resW);
            }


        }
    }
}