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