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

namespace AtCoder
{
    class Program
    {
        public static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string S = Console.ReadLine();
            bool flag = false;
            long res = 0;
            for (int i = 0; i < N; i++)
            {
                if (S[i] == '#') flag = true;
                if (flag && S[i] == '.') res++;
            }
            flag = false;
            long res2 = 0;
            for (int i = N - 1; i >= 0; i--)
            {
                if (S[i] == '.') flag = true;
                if (flag && S[i] == '#') res2++;
            }
            Console.WriteLine(Math.Min(res, res2));
        }
    }
}