/*
 Author : Bisma
 @ copy from bisma template 1.0
 */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <iomanip>
#include <fstream>
#include <cstdio>
using namespace std;
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define repn(a,b,c) for(int a=b; a>=c; a--)
#define ll long long
#define mem(a, b) memset(a, (b), sizeof(a))
#define loop(a,b,c) for(int a = b ;a<c;a++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;

ll max(ll a, ll b){
    if(a>b) return a;
    return b;
}

ll min(ll a, ll b){
    if(a>b) return b;
    return a;
}

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
}



int main(){
    fast();

    ll n;

    string s,a;

    s = "0";
    cin>>n;
    cin>>a;

    s+=a;

    ll ans = 0;
    ll pos = n+1 ;
    rep(i,1,n){

        if(s[i] == '#'){
            pos = i;
            break;
        }
     
    }

    rep(i,pos,n) if(s[i]=='.') ans++;

    ans = min(ans , n - ans);

    ll res = 0;

    pos = 0;

    repn(i,n,1){
        if(s[i] == '.'){
            pos = i;
            break;
        }
    }

    repn(i,pos,1){
        if(s[i] == '#') res++;
    }

    res = min(res , n - res);

    ans = min(ans , res)

    cout<<ans<<endl;

    return 0;
    
}
 




