#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N,count;
    bool flag = false;
    count = 0;
    cin >> N;
    cin >> S;
    
    for(int i=0;i<N;i++){
        if(flag){
            if (S[i] == '.'){
                count++;
            }
        }
        else if (S[i] == '#' && S[i+1] == '.') {
            flagt = true;
        }
    }
    cout << count << endl;
}