using System;
using System.IO;
using System.Linq;

class Program
{
    static void Solve()
    {
        // . -> white, # -> black

        var N = ReadInt();
        var S = Read();

        var whites = new int[N];

        if (S[0] == '.') whites[0]++;

        for (var i = 1; i < N; i++)
        {
            whites[i] = whites[i - 1];
            if (S[i] == '.') whites[i]++;
        }

        var ans = N;
        for(var border = 0; border < N; border++) // end of whites
        {
            var diff = (border - whites[border] + 1) + (whites[N - 1] - whites[border]);
            if (diff < ans) ans = diff;
        }
        Console.WriteLine(ans);
    }

    static void Main(string[] args)
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }

    public static string Read() { return Console.ReadLine(); }
    public static int ReadInt() { return int.Parse(Read()); }
    public static long ReadLong() { return long.Parse(Read()); }
    public static double ReadDouble() { return double.Parse(Read()); }

    public static string[] Reads() { return Console.ReadLine().Split(' '); }
    public static int[] ReadInts() { return Reads().Select(_ => int.Parse(_)).ToArray(); }
    public static long[] ReadLongs() { return Reads().Select(_ => long.Parse(_)).ToArray(); }
    public static double[] ReadDoubles() { return Reads().Select(_ => double.Parse(_)).ToArray(); }
}