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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string s = Console.ReadLine();

            int cntK = 0;
            string w = s;
            for (int i = 0; i < n - 1; i++)
            {
                if (w[i] != w[i + 1])
                {
                    if (w[i] == '#')
                    {
                        w = w.Remove(i + 1, 1).Insert(i + 1, "#");
                        cntK++;
                        continue;
                    }
                    else
                    {
                        w = w.Remove(i, 1).Insert(i, "#");
                        cntK++;
                        continue;
                    }
                }
            }

            int cntS = 0;

            w = s;
            for (int i = 0; i < n - 1; i++)
            {
                if (w[i] != w[i + 1])
                {
                    if (w[i] == '.')
                    {
                        w = w.Remove(i + 1, 1).Insert(i + 1, ".");
                        cntS++;
                        continue;
                    }
                    else
                    {
                        w = w.Remove(i, 1).Insert(i, ".");
                        cntS++;
                        continue;
                    }
                }
            }

            if (cntK > cntS)
            {
                Console.WriteLine(cntS);
            }
            else
            {
                Console.WriteLine(cntK);
            }
        }
    }
}
