using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Math;

namespace AtCodeeeer
{
    class AtCOOOOOOOOOOOder
    {
        static void Main(string[] args)
        {
            int N = int.Parse(ReadLine());
            var s = ReadLine();

            //初期処理
            int kuro = 0;
            int shiro = 0;
            var tmp = s[0];
            bool kuroFlug = false;
            bool shiroFlug = false;


            for (int i = 1; i < N; i++)
            {
                if (tmp == '#' && s[i] == '.')
                {
                    kuro++;
                    kuroFlug = true;
                }

                if (kuroFlug && s[i] == ',')
                {
                    kuro++;
                }

                if (tmp ==  '.' && s[i] == '#')
                {
                    kuroFlug = false;
                }
                //shiro
                if (tmp == '.' && s[i] == '#')
                {
                    shiro++;
                    shiroFlug = true;
                }

                if (shiroFlug && s[i] == '#')
                {
                    shiro++;
                }

                if (tmp == '#' && s[i] == '.')
                {
                    shiroFlug = false;
                }

                tmp = s[i];
            }
            WriteLine(Min(kuro,shiro));
        }
    }
}
