//#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;


int main() {
	int n;
	string s;
	cin >> n >> s ;
	int i = 0;
	int ans = 0;
	int ans1 = 0;
	int ans2 = 0;
	while (i < n && s.at(i) == '.') i++;
	while (i < n) {
		if (s.at(i) == '.') {
			ans1 += 1;
			if (ans1 > ans2) {
				ans += ans2;
				ans1 = 0;
				ans2 = 0;
			}
		}
		else {
			ans2 += 1;
		}
		i++;
	}
	cout << ans+min(ans1,ans2) << endl;
}