#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, y = 0, flag = 1;
  cin >> n;
  char a[n];
  cin >> a;
  for (int i = 0; i < n; i++) {
    if (a[i] == '#')
      x++;
    else
      y++;
  }
  int z = min(x, y);
  cout << z << endl;
  return 0;
}
