using System;
using System.Linq;
using static System.Console;

class Program
{
    public static void Main(string[] args)
    {
        var n = int.Parse(ReadLine());
        var s = ReadLine();

        var c = s.SkipWhile(x=>x=='.').Count(x=>x=='.');
        WriteLine(Math.Min(c, n - c));
    }
}