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

public class Program
{

	static void Main(string[] args)
	{
		var N = int.Parse(Console.ReadLine());
		var S = Console.ReadLine();
		var flag = false;
		var black = 0;
		var white = 0;

		for(int i=0;i<N;i++)
		{
			if (S[i] == '#')
				flag = true;

			if(flag && i +1 != N)
			{
				if (S[i] == '.')
					white++;
				else
					black++;
			}

		}

		if(white > black)
		{
			Console.Write(black);
		}
		else
		{
			Console.Write(white);
		}
	}
}
