#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int i;
  int Black = 0;
  int White = 0;
  for (i = 0; i < S.length(); i++) {
    if (S[i] == '#')
      Black++;
    else
      White++;
  }
  cout << min(Black, White) << endl;
  return 0;
}
