#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int now = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.') {
      now = i;
      break;
    }
  }
  int count = 0;
  int recount = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.') {
      count += 1;
    }
  }
  for (int j = 0; j < now; j++) {
    if (s.at(j) == '#') {
      recount += 1;
    }
  }
  int renow = now;
  cout << min({n - count, recount + count - 1, count}) << endl;
}
