#include <iostream>
#include <string>
#include <algorithm>

using namespace std;


int main(){

	int N;
	int a = 0;
	int b = 0;
	int bl = 0;
	int wh = 0;
	int MIN = 0;


	string S;
	cin >> N >> S;

	for (int i = 0; i < N; i++){
		if (S[i] == '.') wh++;
	}
	MIN = wh + bl;
	for (int i = 0; i < N; i++){
		
		if (S[i] == '.'){
			bl--;
		}
		else wh++;
		if (MIN > wh + bl)	MIN = wh + bl;
	}
	cout << MIN << endl;


	return 0;
}
