using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        string s = Console.ReadLine();
        bool flag = true;
        int sharp = 0;
        int r_sharp = 0;
        for (int i = n - 1; 0 <= i; i--)
        {
            if (flag)
            {
                if (s[i] == '#')
                {
                    sharp++;
                    r_sharp++;
                }
                else flag = false;
            }
            else
            {
                if (s[i] == '#') sharp++;
            }
        }
        int dot = n - sharp;
        int l_dot = 0;
        for (int i = 0; i < n; i++)
        {
            if (s[i] == '.') l_dot++;
            else break;
        }
        Console.WriteLine(Math.Min(dot - l_dot, Math.Min(sharp - r_sharp, Math.Min(dot, sharp))));
    }
}
