#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int b = 0;
  int h = 0;
  int x = 0;
  int y = 0;
  int a = 0;
  int c = 0;
  string s;
  cin >> n >> s;
  h = s.find('#');
  y = s.find('.');
  for (int i = 0; i < n; i++) {
    if (h == -1) {
      break;
    }
    if (s[i] == '#') {
      a++;
    } else {
      c++;
    }
    if (h <= i && s[i + 1] == '.') {
      b++;
    }
  }
  for (int i = 0; i < n; i++) {
    if (y == -1) {
      break;
    }
    if (y <= i && s[i + 1] == '#') {
      x++;
    }
  }
  if (a == c && y >= n / 2) {
    cout << max(b, x) << endl;
  } else
    cout << min(b, x) << endl;
}
