#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int wnum = count((S).begin(), (S).end(), '.');
  int bnum = count((S).begin(), (S).end(), '#');
  cout << min(wnum, bnum) << endl;
}
