#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int N;
  cin >> N >> S;
  int count_front = count(S.begin(), S.end(), '#');
  int count_back = count(S.begin(), S.end(), '.');
  if (count_front > count_back) {
    cout << count_back << endl;
  } else {
    cout << count_front << endl;
  }
  return 0;
}
