#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,ans=INT_MAX;
  string s;
  cin >>n >>s;
  int wcount[n+1];
  wcount[0]=0;
  for(int i=0;i<n;i++){
    if(s[i]=='.')wcount[i+1]=wcount[i]+1;
    else wcount[i+1]=wcount[i];
  }
  for(int i=0;i<n+1;i++){
    ans=min(ans,i-wcount[i]+wcount[n]-wcount[i]);
  }
  cout << ans <<endl;
}