#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p = -1, f = 0, t = 0;
  string s;
  cin >> n >> s;
  vector<bool> u(n);
  for (int a = 0; a < n; a++) {
    if (s[a] == '.') {
      u[a] = true;
      if (p != -1) {
        t++;
      }
    } else {
      u[a] = false;
      if (p == -1) {
        p = a;
      }
      f++;
    }
  }
  cout << ((f > t) ? t : f);
  return 0;
}
