#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main()
{
	int n, p = 0;
	int a[200000];
	string s;

	cin >> n >> s;

	for (int i = 0; i < n; i++) {
		if (s[i] == '.')
			p++;

		a[i] = p;
	}

	int m = p;

	for (int i = 0; i < n; i++)
		m = min(p + i + 1 - a[i] * 2, m);	

	cout << m << endl;

	return 0;
}
