#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int num_w = 0, num_b = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '.') num_w++;
    if (s[0] == '.')
      num_w--;
    else
      num_b++;
  }
  if (num_w < num_b) {
    if (s[n - 1] == '.') {
      num_w++;
    }
    cout << num_w << endl;
  } else {
    cout << num_b << endl;
  }
}
