using System;
using System.Linq;

class C
{
	static void Main()
	{
		Console.ReadLine();
		var s = Console.ReadLine();

		var m = s.Count(c => c == '.');
		Console.WriteLine(s.Min(c => m += c == '.' ? -1 : 1));
	}
}
