#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char c[n];
  for (int i = 0; i < n; i++) cin >> c[i];
  int b = 0;
  int w = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == '#')
      b++;
    else
      w++;
  }
  if ((w == 0) || (b == 0))
    cout << 0 << endl;
  else if (w == b)
    cout << w << endl;
  else if (w > b)
    cout << b << endl;
  else
    cout << w << endl;
}
