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

class Program
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        int N = int.Parse(input);
        input = Console.ReadLine();
        char[] S= input.ToCharArray();
        int white_all = 0;
        int white = 0;
        int black = 0;
        for(int i = 0; i < N; i++)
        {
            if (S[i] == '.') { white_all++; }
        }
        int ans = S.Length;
        if (white_all == S.Length||white_all==0) ans = 0;
        for(int i = 0; i < N; i++)
        {
            if(S[i] == '#') { black++; }
            else { white++; }
            if (i<N-1&&S[i] == '#' && S[i + 1] == '.') { ans = Math.Min(ans, black + (white_all - white-1)); }
        }
        Console.WriteLine(Math.Min(S.Length-white,Math.Min(S.Length-black,ans)));
    }
}