using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;



class Program
{
    const int MOD = 1000000007;
    const int INF = 1 << 30;

    static void Main(string[] args)
    {
        Solve();
    }



    static void Solve()
    {
        Scan sc = new Scan();
        write wr = new write();


        var N = sc.intarr[0];
        var S = sc.str;
        int kuro = 0;
        int shiro = 0;
        for (int i = 0; i < N; ++i)
        {
            if (S[i] == '#') kuro++;
        }
        int j = 0;
        while ( j < N&&S[j] == '.')
        {
            j++;
            shiro++;
        }
        int k = 0;
        S.Reverse();
        int kuro2 = 0;
        while (k < N&&S[k] == '.' )
        {
            j++;
            kuro2++;
        }

        wr.wri(Math.Min(kuro - kuro2, N - kuro - shiro));


    }
}





class Scan
{
    public string str => Console.ReadLine();

    public string[] strarr => str.Split(' ');

    public long[] longarr => strarr.Select(long.Parse).ToArray();
    public int[] intarr => strarr.Select(int.Parse).ToArray();
    public char[] chararr => str.ToArray();


}



class write
{
    public void wri<Type>(Type x)
    {
        Console.WriteLine(x);
    }
}
