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();
        int ans = 0;
        for (int i = n - 1; 0 <= i; i--)
        {
            if (s[i] == '.') ans++;
        }
        int dot = ans;
        int sharp = n - dot;

        for (int i = 0; i < n; i++)
        {
            if (s[i] == '.') ans--;
            else break;
        }
        ans = Math.Min(ans, Math.Min(dot, sharp));
        Console.WriteLine(ans);
    }
}
