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