#include<iostream>
using namespace std;

long long int main(){
  long long int N;
  string S; //. white, # black
  bool Flag = false;
  long long int res = 0;
  cin >> N >> S;

  for(long long int i=0; i<N; i++){
    if(!Flag){
      if(S[i] == '#') Flag = true;
    }else if(Flag){
      if(S[i] == '.') res++;
    }
  }

  cout<<res<<endl;
  return 0;
}