#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int minCount = N;
  int rightW = 0;
  int leftB = 0;
  for (int j = 0; j < N; j++) {
    if (S[j] == '.') rightW++;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      rightW--;
    } else {
      leftB++;
    }
    if (minCount > leftB + rightW) minCount = leftB + rightW;
  }
  cout << minCount << endl;
  return 0;
}
