#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int start = -1;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      start = i;
      break;
    }
  }
  int b_count = 0;
  int w_count = 0;
  if (start >= 0) {
    for (int i = start; i < N; i++) {
      if (S.at(i) == '.') {
        b_count++;
      } else {
        w_count++;
      }
    }
  }
  if (b_count < w_count) {
    cout << b_count << endl;
  } else {
    cout << w_count << endl;
  }
  return 0;
}
