#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;

int main() {
	char S[1000000 * 2 + 1] = {};
	int N, ans = 0,count;
	bool flag = false;
	cin >> N >> S;
	for (int i = 0; i < N; i++)
	{
		if (!flag&&S[i] == '#')
		{
			flag = true;
		}
		if (S[i] == '#')
		{
			count++;
		}
		if (flag&&S[i] == '.')
		{
			ans++;
		}
		ans = min(ans, count);
	}
	cout << ans;
	return 0;
}