using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System.Text.RegularExpressions;

class Program
{
    const string Yes = "Yes";
    const string No = "No";
    const char White = '.';
    const char Black = '#';
    const long Mod = 1000000007;

    static void Main(string[] args) {
#if DEBUG
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        var n = int.Parse(input.ReadLine());
        var s = input.ReadLine();

        var list = new List<int>();
        var co = 1;

        for(int i=1; i<n; i++) {
            if(s[i-1] != s[i]) {
                list.Add(co);
                co=0;
            }
            co++;
        }
        list.Add(co);

        if(s[0] == White) list[0] = 0;
        if(s[n-1] == Black) list[list.Count-1] = 0;

        var count1 = 0;
        var count2 = 0;
        for(int i=0; i<list.Count; i++) {
            if(i%2==0) count1 += list[i];
            else count2 += list[i];
        }

        return Math.Min(count1, count2);
    }

    static int[] ToIntArray(string strs, int n) {
        var ret = new int[n];
        var spl = strs.Split(' ');
        for (int i = 0; i < n; i++)
            ret[i] = int.Parse(spl[i]);
        return ret;
    }
}