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_num = 0;
        int black_num = 0;
        int conv_num = 0;
        int back_num = 0;
        int flag = 0;
        for(int i = 0; i < N; i++)
        {
            if (S[i] == '#')
            {
                white_num++;
                if (flag == 0)
                {
                    flag = 1;
                    conv_num++;
                }
                else if (flag == 1)
                {
                    flag = 2;
                    conv_num++;
                }
            }
            else { black_num++;
                if (flag == 2) { conv_num++; }
            }
        }
        int back = 0;
        for (int i = N-1; i >=0; i--)
        {
            if (S[i] == '#')
            {
                if (back == 1) { back_num++; }
            }
            else
            {
                if (back == 0) { back = 1; }
            }
        }
            Console.WriteLine(Math.Min(Math.Min(conv_num,back_num),Math.Min(white_num,black_num)));
    }
}