#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      break;
    }
    s[i] = 'x';
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      break;
    }
    s[i] = 'x';
  }
  int cnt_w = 0;
  int cnt_b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      cnt_w++;
    }
    if (s[i] == '#') {
      cnt_b++;
    }
  }
  cout << min(cnt_w, cnt_b) << endl;
  return 0;
}
