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

class myon
{
    public static void Main(string[] args)
    {
        var myon = new myon();
    }

    public myon()
    {
        int N = int.Parse(Console.ReadLine());
        string S = Console.ReadLine();

        int o = 0;
        int lastW = 0;
      bool flag = false;
        for (int i = 0; i < N; i++)
        {
            //黒
            if (S[i] == '#' && flag == false)
            {
                o = CountLater(i,S,N);
              	flag = true;
            }
            else if(S[i] == '.')
            {
                lastW = i;
            }
        }

        int o2 = 0;
        for(int i = 0;i <= lastW; i++)
        {
            if (S[i] == '#') o2++;
        }

		//Console.WriteLine(o);
      	//Console.WriteLine(o2);
        Console.WriteLine(Math.Min(o,o2));
    }


    int CountLater(int Start,string S,int N)
    {
        int count = 0;
        for (int i = Start; i < N; i++)
        {
            if (S[i] == '.') count++;
        }

        return count;
    }
}
