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;
        int ans = N;
        int sum = 0;
        for (int i = 0; i < N; ++i)
        {
            if (S[i] == '#')
            {
                kuro = i;
                break;
            }
        }
        for(int i = kuro; i < N; ++i)
        {
            if (S[i] == '.') sum++;
        }
        ans = Math.Min(ans, sum);
        sum = 0;
        S.Reverse();
        for (int i = 0; i < N; ++i)
        {
            if (S[i] == '.')
            {
                shiro = i;
                break;
            }
        }
        for (int i =    shiro; i < N; ++i)
        {
            if (S[i] == '#') sum++;
        }
        ans = Math.Min(ans, sum);



        wr.wri(ans);


    }
}





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);
    }
}
