using namespace std;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
 
	ll N, M, K;
	string S;
 
	cin >> N >> S;
 
	ll W = 0;
	ll B = 0;
 
	rep(i, N) {
		if (S[i] == '.')W++;
		if (S[i] == '#')B++;
	}
 
	ll min = W;
	B = 0;
 
	rep(i, N) {
		if (S[i] == '.')W--;
		if (S[i] == '#')B++;
		if (min > (W + B)) {
			min = (W + B);
		}
	}
 
 
	cout << min << endl;
 
 
	
	return 0;
}