#include <bits/stdc++.h>
using namespace std;
/*int unchi(){
	int N;
	string S;
	cin >> N >> S;
	int boarder = 0;
	int min = 0;
	for(int i = 0; i <= N; i++){
		int count = 0;
		for(int j = 0; j < N; j++){
			if(i <= j){
				if(S[i] != '.')
					count++;
			}else{
				if(S[i] != '#')
					count++;
			}
		}
		if(min > count)
			min = count;
	}
	cout << min << endl;
}*/

int main(){
	int N;
	string S;
	cin >> N >> S;
	vector<int> sdat(N);
	int tmp = 0;
	char c = '.'
	for(int i = 0; i < N; i++){
		if(S[i] != c){
			c = S[i];
			tmp++;
		}
		sdat[tmp]++;
	}
	int boarder = 0;
	int min = 0;
	for(int i = 0; i <= sdat.size(); i++){
		int count = 0;
		for(int j = 0; j < sdat.size(); j++){
			if(i > j){
				if(sdat[j]%2)
					count += sdat[j];
			}else{
				if(sdat[j]%2-1)
					count += sdat[j];
			}
			if(min > count)
				min = count;
		}
	}
	cout << min << endl;
}