#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int leftblack = 0;
  int rightwhite = 0;
  bool blackdeta = false;
  int i;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      blackdeta = true;
      leftblack++;
    } else {
      if (blackdeta) rightwhite++;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (s[i] == '#')
      leftblack--;
    else
      break;
  }
  cout << min(leftblack, rightwhite) << endl;
}
