#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int w, b;
  w = 0;
  b = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i] == '.') {
      w++;
    }
    if (S[i] == '#') b++;
  }
  if (w == 0)
    cout << "0";
  else if (b < w && (N - b) < b)
    cout << (N - b);
  else if (b < w)
    cout << b;
  else
    cout << w;
  return 0;
}
