using System;
using System.Collections.Generic;
using System.Linq;

public class Program{
    public static void Main(){
        
        var n = int.Parse(Console.ReadLine());
        
        var s = Console.ReadLine();
        
        var min = n;
        for(var border = 0; border < n; border++){
            var cnt = 0;
            for(var i = 0; i < n; i++){
                if(border >= i){
                    if(s[i] =='#'){
                        cnt++;
                    }
                }else{
                    if(s[i] == '.'){
                        cnt++;
                    }
                }
            }
            if(min > cnt){
                min = cnt;
            }
        }
        Console.WriteLine("{0}",min);
    }
}
