#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N;string S;int count;int kuro;int siro;int j;int n;
  cin>>N; cin>>S;
  kuro=0;
  
   for (int i = 0; i < N; i++) {  
   if(S.at(i)=='#'){
     j=i;
     n=i;
      while( j < N) {
     if(S.at(j)=='#'){kuro=kuro+1;
                      j++;}
   }
     break;}
   }
  
  if(kuro=0){
  cout<<0<<endl
  }
 else{ siro=N-(n+kuro);
  
   if(kuro<siro){
     cout<<kuro<<endl;
     }else{
     cout<<siro<<endl;}
     }
}
  
