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