using System;
using System.Linq;

namespace T1PBC
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            char[] s = Console.ReadLine().ToCharArray();

            int w = s.Count(x => x == '.');
            int b = s.Count(x => x == '#');

            if (w < b)
            {
                Console.WriteLine(w);
            }

            if (b < w)
            {
                if (s[n - 1] == '#') b--;
                Console.WriteLine(b);
            }

            if (b == w)
            {
                if (s[n - 1] == '#') b--;
                Console.WriteLine(b);
            }

        }
    }
}