#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
using namespace std;
using ll=long long;
const ll MOD=100000007;
const ll LINF=0x1fffffffffffffff;
const int INF=0x3fffffff;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans%MOD*(b&1?a:1)%MOD;
}
inline constexpr int modf(ll n){
    ll ans=1;
    rep(i,0,n) {ans=ans*(n-i)%MOD;}
    return ans;
}
inline long double median(vector<ll> v){
    ll size=v.size();
    sort(v.begin(),v.end());
    if (size % 2 == 1) return v[(size - 1) / 2];
    else return (v[(size / 2) - 1] + v[size / 2]) / 2;
}


int main(){
    ll n;
    cin>>n;
    string s;
    cin>>s;
    vector<ll>c(1000000);
    bool w=0,f=0;
    if(s[0]=='.') w=1;
    c[0]++;
    ll k=0;
    rep(i,1,n){
        if(s[i-1]!=s[i]) {k++;f=!f;w=0;}
        if(!w) c[k]++;
    }
    if(k==0) {cout<<0;return 0;}
    if(k/2==0) {
        k++;
        c[k]=0;
    }
    vector<ll> ans(k+1);
    rep(i,0,k+1){
        if(i>0) rep(j,0,i){
            ans[i]+=c[2*j];
        }
        rep(j,0,(k+1)/2-i){
            ans[i]+=c[k-2*j];
        }
    }
    cout<<*min_element(ans.begin(),ans.end());
}