#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
int main() {
  int n, white = 0, black = 0, flag;
  string s;
  cin >> n >> s;
  for (int i = 0; i < (int)n; i++) {
    if (s[i] == '#') {
      flag = i;
      break;
    }
  }
  for (int i = flag; i < n; i++) {
    if (s[i] == '.') black++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      flag = i;
      break;
    }
  }
  for (int i = flag; i >= 0; i--) {
    if (s[i] == '#') white++;
  }
  cout << min(white, black) << endl;
  return 0;
}
