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