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