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

int main() {
	int N;
	cin >> N;
	char a[N];
	cin >> a;
	char b[N]
    strcpy(a, b);
	int cnt = 0;
	int cnta = 0;
	for (int i = N-1; i > 0; i--) {
		if (b[i] == '.') {
			if (b[i-1] == '#' ) {
				b[i - 1] == '.'
					cnta += 1;
			}
			
		}
	}
	for (int i = 0; i < N-1; i++) {
		if (a[i] == '#') {
			if (a[i+1] == '.') {
				a[i+1] = '#';
				cnt += 1;
			}
		}
	}
	if (cnt <= cnta) {
		cout << cnt << endl;
	}
	else
	{
		cout << cnta << endl;
	}
}