#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string stone;
  cin >> n >> stone;
  int a = 0, b = 0;
  int kokomade;
  for (int i = n - 1; i >= 0; i--) {
    if (stone.at(i) == '.') {
      kokomade = n;
      break;
    } else if (stone.at(i) == '#') {
      kokomade = i;
      break;
    }
  }
  for (int i = 0; i < kokomade; i++) {
    if (stone.at(i) == '#') {
      a++;
    }
  }
  for (int i = 0; i < kokomade; i++) {
    if (stone.at(i) == '.') {
      b++;
    }
  }
  int answer = min(a, b);
  cout << answer << endl;
}
