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

  return 0;
}
