#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(int i = a;i < n;i++)
#define LINF (ll)1e17
#define INF 1e9
#define MOD 1e9+7
#define sMOD 1e5
#define fs first
#define sc second

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
}


signed main(){
	ll n,cnt = 0,cnt2 = 0;
	string s,t;
	cin >> n >> s;
	
	t = s;
	
	
	rep(i,0,s.size()-1){
		if(s[i] == '#' && s[i+1] == '.'){
			s[i+1] = '#';
			cnt++;
		}
	}
	
	rep(i,0,t.size()-1){
		if(t[t.size()-i-2] == '#' && t[t.size()-i-1] == '.'){
			t[t.size()-i-2] = '.';
			cnt2++;
		}
	}
	
	s.size() - s.size() + 2 - 2
	
	cout << min(cnt,cnt2) << endl;
	return 0;

}