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

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

            int sum1 = 0;
            bool found = false;

            for (int i = 1; i < n; i++)
            {
                if (s[i - 1] == '#' && s[i] == '.') found = true;
                if (found && s[i] == '.') sum1++;
            }

            int sum2 = 0;
            found = false;

            for (int i = n - 2; i >= 0; i--)
            {
                if (s[i + 1] == '.' && s[i] == '#') found = true;
                if (found && s[i] == '#') sum2++;
            }
            Console.WriteLine(sum1 > sum2 ? sum2 : sum1);
        }
    }
}
