#include <bits/stdc++.h>
using namespace std;
int c1(string S) {
  int db = 0;
  for (int i = S.length() - 2; i >= 0; i--) {
    if (S[i] == '#' && S[i + 1] != '#') {
      db++;
      S[i] = '.';
    }
  }
  return db;
}
int c2(string S) {
  int dw = 0;
  for (int i = 0; i < S.length(); i++) {
    if (S[i] == '.') {
      dw++;
    }
  }
  return dw;
}
int main() {
  int N;
  string S;
  cin >> N >> S;
  if (S.length() == 1) {
    cout << 0 << endl;
    return 0;
  }
  int db = c1(S);
  int dw = c2(S);
  cout << min(dw, db) << endl;
}
