#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int n;
  string s;
  int ans = 0;
  cin >> n >> s;
  int black = 0;
  int white = 0;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '.' && i != 0) {
      white++;
    } else if (s[i] == '#' && i != n - 1) {
      black++;
    }
  }
  cout << min(white, black) << endl;
}
