using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        var N = int.Parse(ReadLine());
        var S = ReadLine();

        var f = 0;
        for (int i = 0; i < N; i++)
        {
            if (S[i] == '#')
            {
                f = i;
                break;
            }
        }
        var b = 0;
        var w = 0;
        for (int i = f; i < N; i++)
        {
            if (S[i] == '#') b++;
            else w++;
        }
        WriteLine(Min(b, w));
    }
}

