using System;

public class Program
{
    public static void Main()
    {
        
        var num=int.Parse(Console.ReadLine());
        var line=Console.ReadLine();
        
        var count=0;
        var x=0;
        for(var i=0;i<num;i++){
            if(line[i]=='#')x=1;
            if(x==1&&line[i]=='.')count+=1;
        }
        if(count==0||count==num)Console.WriteLine(0);
        else Console.WriteLine(count);
        
    }
}