#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  bool black = false, white = true;
  int cnt_w = 0, cnt_b = 0, _cnt_b = 0;
  for (int i = (0); i < ((n)); i++) {
    if (s[i] == '.') {
      white = true;
      cnt_b += _cnt_b, _cnt_b = 0;
      if (black) cnt_w++;
    } else {
      black = true;
      _cnt_b++;
    }
  }
  cout << min(cnt_w, cnt_b) << endl;
}
