#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  int len;
  int ans = 0;
  int gomi;
  cin >> len;
  cin >> str;
  int allBlack = 0;
  int vaisu = 0;
  int lastWhite = 0;
  for (int i = 0; i < len; i++) {
    if (str[i] == '.') allBlack++;
  }
  for (int i = len - 1; i >= 0; i--) {
    if (str[i] == '.') {
      lastWhite = i;
      break;
    }
  }
  for (int i = 0; i < lastWhite; i++) {
    if (str[i] == '#') vaisu++;
  }
  cout << min(allBlack, vaisu) << endl;
  return 0;
}
