#include <iostream>
#include <iomanip>
#include <string>
typedef long long ll;
using namespace std;
const  ll INF = 1e9;
const  ll MOD = 1e9 + 7;
#define repi(i,n,init) for(ll i=init;i<(n);i++)

int main()
{
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    repi(i,n-1,0){
        if(s[i]=='#' && s[i+1] == '.'){
            ans++;
            s[i+1] = '#';
        }
    }
    cout << ans << endl;
    return 0;
}