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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var s = Console.ReadLine().Trim().Select(x => x == '.' ? 0 : 1).ToArray();

        var sum = new int[s.Length + 1][];
        sum[0] = new int[2];
        for (int i = 1; i < sum.Length; i++)
        {
            sum[i] = new int[sum[i - 1].Length];
            for (int j = 0; j < sum[i].Length; j++)
            {
                sum[i][j] = sum[i - 1][j];
            }
            sum[i][s[i - 1]]++;
        }

        var minimum = int.MaxValue;
        for (int i = 1; i < sum.Length; i++)
        {
            var w = sum.Last()[0] - sum[i][0];
            var b = sum[i][1]; // - sum.First()[1];
            minimum = Math.Min(minimum, w + b);
        }
        Console.WriteLine(minimum);
    }
}
