#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ans = 0, numW = 0, numB = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') numW++;
    if (S[i] == '.') numB++;
  }
  cout << min(numW, numB) << endl;
  return 0;
}
