#include <bits/stdc++.h>

using namespace std;

#define Rep(i,a,b)  for (int i=(a);i<(b);i++)
#define rep(i,n)    for (int i=0;i<(n);i++)
#define all(x)      (x).begin(), (x).end()

#define ll long long

int main()
{
	int n;
	string s;
	cin >> n;
	cin >> s;
	int w = count(all(s), '.');
	int b = w;
	rep (i, n) {
		if (s[i] == '#')
			w++;
		else
			w--;
		if (b > w)
			b = w;
	}
	cout << b << endl;
}

