#include <bits/stdc++.h>
using namespace std;
using ll=long long;
 
 
int main(){
  int N;
  string S;
  cin>>N>>S;
 
  int dot=0;
  //累積和
  int dotcount[200010]={0};
  int sharpcount[200010]={0};
  for(int i=0;i<N;i++){
    if(S[i]=='.')  dot++;
    dotcount[i+1]=dot;
    sharpcount[i+1]=i+1-dot;
  }
 
  int ans=10e6+1;
  for(int i=0;i<=N;i++){
    
    ans=min(ans,sharpcount[i]+dotcount[N]-dotcount[i]);
  }
  cout<<ans<<endl;
 
  return 0;
}