#include <bits/stdc++.h>
using namespace std;
int main() {
  int white = 0, black = 0;
  bool white_flag = false, black_flag = true;
  int n;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> c;
    if (c == '.') {
      if (!black_flag) {
        black_flag = true;
      }
      if (white_flag) {
        white++;
      }
    } else {
      if (!white_flag) {
        white_flag = true;
      }
      if (black_flag) {
        black++;
      }
    }
  }
  int ans = 0;
  white <= black ? ans = white : ans = black;
  cout << ans << endl;
}
