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