#include <bits/stdc++.h>
using namespace std;
int countcolour(string& s, int n, char c) {
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == c) {
      count++;
    }
  }
  return count;
}
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int a = countcolour(s, n, '#');
  int b = countcolour(s, n, '.');
  if (a > b) {
    cout << b << endl;
  } else {
    cout << a << endl;
  }
}
