using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class ABC
{

    public static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();

        //全部#にしてしまう
        int allsharp = 0;
        for (int i = 0; i < S.Length; i++)
        {
            if (S[i] == '.') allsharp++;
        }

        int almostalldot = 0;
        for (int i = 0; i < S.Length-1; i++)
        {
            if (S[i] == '#') almostalldot++;
        }
        Console.WriteLine(Math.Min(allsharp, almostalldot));
        
    }
}