using System;
using System.Linq;

class Program {
    static void Main (string[] args) {
        var N = int.Parse (Console.ReadLine ());
        var S = Console.ReadLine ();
        var a = S.Select(x=>x==char.Parse(".")? 0:1).ToArray();
        int cnt =0;

        for(var i =N-1;i>0;i--)
        {
            if(a.Take(i).Sum()>a.Skip(i).Sum())
            {
                if(a[i]==0)cnt++;
            }
            else
            {
                if(a[i]==1)cnt++;
            }
        }
        Console.WriteLine(cnt);
    }
}