#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int sum1 = 0, sum2 = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '#')
      ++sum1;
    else
      ++sum2;
  }
  cout << min(sum1, sum2) << endl;
  return 0;
}
