import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {

	auto N = readln.split[0].to!int;
	auto S = readln.split[0].to!(dchar[]);
	auto S_ = S.dup.reverse().array;
	
	auto bi = S.indexOf('#'), wi = S_.indexOf('.');
	writeln( min( S[bi+1 .. $].count('.'), S_[wi+1 .. $].count('#') ) );
	
}

