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