using System;

namespace C___Stones
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var S = Console.ReadLine().ToCharArray();
            char[] b_arr = new char[N], w_arr = new char[N];
            Array.Copy(S, b_arr, N);
            Array.Copy(S, w_arr, N);
            int b_count = 0, w_count = 0;

            for (int i = 0; i < N - 1; i++)
            {
                if ((b_arr[i] == '#') && (b_arr[i + 1] == '.'))
                {
                    b_arr[i + 1] = '#';
                    b_count++;
                }

            }

            for (int i = N - 1; i > 0; i--)
            {
                if ((w_arr[i] == '.') && (w_arr[i - 1] == '#'))
                {
                    w_arr[i - 1] = '.';
                    w_count++;
                }
            }

            Console.WriteLine(Math.Min(b_count, w_count));
        }
    }
}
