#include <cstdio>
#include <iostream>
#include <algorithm>

#define WHITE '.'
#define BLACK '#'

using namespace std;

int main() {
	int white = 0, black = 0;
	bool white_flag = false;

	int n;
	char c;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> c;
		if (c == WHITE) {
			if (!black_flag) {
				black_flag = true;
			}
			if (white_flag) {
				white++;
			}
		}
		else {
			black++;
		}
	}
	int ans = 0;
	white <= black ? ans = white : ans = black;
	cout <<  ans << endl;
}