#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <set>
#include <numeric>
#include <bitset>
#include <map>
#include <limits.h>
using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;
const int INF = 1e9;

long long gcd(long long x, long long y){
			if(x<y){
				long long temp = x;
			x = y;
				y = temp;
			}
			long long r = x % y;
				while(r!=0){
					x = y;
					y = r;
				r = x % y;
	    		}
			return y;
	    }

int main(){
int N;
string S_1;
cin >> N;
cin >> S_1;
int n;
int cnt_1 = 0;
int cnt_2 = 0;
string S_2 = S_1;
string S_1r =S_1;
string S_2r =S_1;
reverse(S_1r.begin(),S_1r.end());
reverse(S_2r.begin(),S_2r.end());
int cnt_1r = 0;
int cnt_2r = 0;
for(int i = 0; i< N-1;i ++){
    if(S_1[i] == '#' && S_1[i+1] =='.'){
        cnt_1++;
        S_1[i+1] = '#';
    }
for(int i = 0; i< N-1;i ++){
    if(S_1r[i] == '.' && S_1[i+1] =='#'){
        cnt_1r++;
        S_1r[i] = '#';
    }
    if(cnt_1 = 0)cnt_1 = cnt_1r;
for(int i = 0; i< N-1;i ++){
    if(S_2[i] == '#' && S_2[i+1] =='.'){
        cnt_2++;
        S_2[i] = '.';
    
    }
}
   for(int i = 0; i< N-1;i ++){
    if(S_2r[i] == '.' && S_2[i+1] =='#'){
        cnt_2r++;
        S_2r[i+1] = '.';
    }
}
if(cnt_2 = 0)cnt_2 = cnt_2r;

cout << min(cnt_1,cnt_2) << endl;
}
