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