#include <bits/stdc++.h>
using namespace std;

int main(){
  long long n;
  int flag1=0,flag2=0;  
  string s;
  string black,white;
  cin >> n >> s;
  long long count1=0 , count2=0;
  black = s;
  white = s;
  
  for(long long i=0; i<n; i++){
    if(flag1==0){
      if(black.at(i) == '#'){
        flag1=1;
      }
    }else{
      if(black.at(i) == '.'){
        count1++;
      }
    }
  }
  
  for(long long i=n-1; i => 0; i--){
    if(flag2==0){
      if(white.at(i) == '.'){
        flag2=1;
      }
    }else{
      if(white.at(i) == '#'){
        count2++;
      }
    }
  }

  if(count1 < count2){ 
    cout << count1 << endl;
  }else{
    cout << count2 << endl;
  }
}