#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int white = 0, black = 0;
  for (char& c : S) {
    if (c == '.')
      white++;
    else
      black++;
  }
  int leftWhite = 0, rightWhite = white;
  int leftBlack = 0, rightBlack = black;
  int ans = min(white, black);
  for (int inx = 0; inx < N; inx++) {
    if (S[inx] == '.') {
      leftWhite++;
      rightWhite--;
    }
    {
      leftBlack++;
      rightBlack--;
    }
    ans = min(ans, leftBlack + rightWhite);
  }
  cout << ans << endl;
  return 0;
}
