#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<char> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  long long ans = 0, first = 0, last = 0;
  long long wh = 0, bl = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      last = i;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#' && s[i + 1] == '.') {
      first = i;
    }
  }
  for (int i = 0; i <= last; i++) {
    if (s[i] == '#') wh++;
  }
  for (int i = last; i < n; i++) {
    if (s[i] == '.') bl++;
  }
  ans = min(wh, bl);
  cout << ans << endl;
}
