using System;

public class Program
{
    public static void Main()
    {
        
        var num=int.Parse(Console.ReadLine());
        var line=Console.ReadLine();
        
        var count1=0;
        var x=0;
        for(var i=0;i<num;i++){
            if(line[i]=='#')x=1;
            if(x==1&&line[i]=='.')count1+=1;
            if(count1>num/2)break;
        }
        var count2=0;
        var y=0;
        for(var i=num-1;i>=0;i--){
            if(line[i]=='.')y=1;
            if(y==1&&line[i]=='#')count2+=1;
            if(count2>num/2)break;
        }
        var count=count1;
        if(count2<count1)count=count2;
        
        Console.WriteLine(count);
        
    }
}
