unittest
{
	assert( [ "3", "#.#" ].parse.expand.solve == 1 );
	assert( [ "5", "#.##." ].parse.expand.solve == 2 );
	assert( [ "9", "........." ].parse.expand.solve == 0 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto n = input.front.to!( long );
	input.popFront;
	auto s = input.front;
	return tuple( s );
}

auto solve( string s )
{
	auto ans = 0L;
	auto b = false;
	foreach( c; s )
	{
		if( !b ) b    = ( c == '#' );
		else     ans += ( c == '.' );
	}
	return ans;
}
