using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using static System.Math;
using System.Linq;
using static System.Array;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = long.Parse(Console.ReadLine());
            //va0r NKMR = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            var S = Console.ReadLine();

            var L = 0;
            var R = N - 1;

            //右から見ていって最初の白を探す．
            for (; R >= 0; R--)
            {
                if (S[(int)R] == '.')
                {
                    break;
                }
            }

            for (; L < N; L++)
            {
                if (S[(int)L] == '#')
                {
                    break;
                }
            }

            var black = 0L;
            var white = 0L;

            for (int i = L; i <= R; i++)
            {
                if (S[(int)i] == '#')
                {
                    black++;
                }
                else
                {
                    white++;
                }
            }

            Console.WriteLine(Min(black,white));
            
        }
    }


}
