using System;
					
public class Program
{
	public static void Main()
	{
		//°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸Kobato Love°º¤ø,¸¸,ø¤º°`°º¤ø,¸,ø¤°º¤ø,¸¸,ø¤º°`°º¤ø,¸
		int a;
		string b;
		a = int.Parse(Console.ReadLine()); 
		b = Console.ReadLine(); 
		int count = 0;
		
		for(int i = 0; i < a-1; i++)
		{
			if(b[i] == '#')
			{
				int x = 0;
				int y = 0;
				bool bo = false;
				while(true)
				{	//Console.WriteLine(x +" "+y);
					if(!bo){
						try{
							if(b[i+x+1] == '#')
							{
								x++;
							}
							else
							{
								bo = true;	
							}
						}
						catch(Exception e)
						{
							break;
						}
					}
					else
					{
						try{
							if(b[i+x+1] == '.')
							{
								x++;
								y++;
							}
							else
							{
								if(y <= x)
								{
									count += y;
								}
								else
								{
									count += x;
								}
								i += x;
								break;
							}
						}
						catch(Exception e)
						{
							if(y <= x)
								{
									count += y;
								}
								else
								{
									count += x;
								}
								i += x;
								break;
						}
					}
				}
			}
		}
		Console.WriteLine(count);
		
		
	}
}
