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 = white_all;
        int counter = 0;
        if (white_all == S.Length || white_all == 0) ans = 0;
        else
        {
            for (int i = 0; i < N; i++)
            {
                if (S[i] == '#') { black++; }
                else { white++; }
                counter = black + white;
                if (counter < ans) { ans = counter; }
            }
        }
        Console.WriteLine(ans);
    }
}