using System;
using System.Linq;
using static System.Math;
using static System.Console;

partial class Program
{
    public static void Main(string[] args)
    {
        var n = int.Parse(ReadLine());
        var s = ReadLine();

        int count = 0;
        char cOld = s[0];
        for (int i = 1; i < n; i++)
        {
            var c = s[i];
            if (cOld == '.' && c == '#')
            {
                c = '.';
                count++;
            }
            else if (cOld == '#' && c == 'c')
            {
                c = '#';
                count++;
            }
            cOld = c;
        }

        WriteLine(count);
    }
}