#include <iostream>
//#include <vector>
#include <string>
#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1
//#define INFTY 1000000000000000000

int main(){
    LL n;
    string s;
    cin >> n;
    cin >> s;
    LL num_s=0;
    LL num_d=0;
    bool is_count_s=false;
    LL tmp_count_d=0;
    if(s[0]=='#'){
        tmp_count_d++;
        is_count_s=true;
    }
    for(LL i=0; i<n; i++){
        if(is_count_s==true && s[i]=='.'){
            num_s++;
        }
        if(s[i-1]=='#' && s[i]=='.'){
            num_d+=tmp_count_d;
            tmp_count_d=0;
        }
        if(s[i]=='#'){
            tmp_count_d++;
            is_count_s=true;
        }
    }

    LL ans=min(num_s, num_d);
    cout << ans << endl;

    return 0;
}
