#include<iostream>
using namespace std;
int main() {
  int N,i,countW[200001],countB[200001],ans=200001;
  char S[200001];
  cin >> N >> S;
  countW[0]=0;countB[0]=0;
  for(i=0;i<N;i++) {
    countW[i+1] = countW[i];
    countB[i+1] = countB[i];
    if(S[i] == '.')countW[i+1]++;
    else countB[i+1]++;
  }
  for(i=0;i<N+1;i++) {
    if(ans > countB[i]+countW[N]-countW[i])ans = countB[i]+countW[N]-countW[i];
  }
  cout << ans << endl;
}