#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int w = 0, b = 0;
  for (char c : S)
    if (c == '#') w++;
  bool f = false;
  for (char c : S) {
    if (c == '#')
      f = true;
    else if (f)
      b++;
  }
  cout << min(b, w) << endl;
}
