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[]);
	
	ulong[] wnum = [0], bnum = [S.count('#')];
	foreach (d; S) {
		if (d == '.') wnum ~= wnum[$-1]+1, bnum ~= bnum[$-1];
		else wnum ~= wnum[$-1], bnum ~= bnum[$-1]-1;
	}
	
	//writeln(wnum, bnum);
	ulong ans = int.max;
	foreach (i; 0 .. wnum.length) {
		ulong tmp;
		tmp = i-wnum[i] + (N-i)-bnum[i];
		ans = min(ans, tmp);
	}
	writeln(ans);
}

