#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int solve() {
  int pos = 0;
  int pos1 = S.find("#.");
  if (pos1 == string::npos) {
    return 0;
  }
  int pos2 = S.find(".#");
  if (pos2 != string::npos && pos1 > pos2) {
    pos = pos2 + 1;
  }
  int w = 0;
  int b = 0;
  for (int i = pos; i < S.size(); i++) {
    if (S[i] == '.') {
      w++;
    } else {
      b++;
    }
  }
  if (S[S.size() - 1] == '#') {
    b--;
  }
  return min(w, b);
}
int main() {
  cin >> N >> S;
  cout << solve() << endl;
  return 0;
}
