#include <bits/stdc++.h>
using namespace std;
int N;
string S;
int main() {
  cin >> N >> S;
  int p = -1;
  int ctw = 0;
  int ctb = 0;
  string SB = S;
  string SW = S;
  for (int i = 0; i < (N); ++i) {
    if (S[i] == '#') {
      p = i;
    }
    if (p >= 0) {
      SB[i] = '#';
    }
  }
  p = -1;
  for (int i = N - 1; i >= 0; --i) {
    if (S[i] == '.') {
      p = i;
    }
    if (p >= 0) {
      SW[i] = '.';
    }
  }
  for (int i = 0; i < (N); ++i) {
    if (S[i] != SB[i]) ctb++;
    if (S[i] != SW[i]) ctw++;
  }
  cout << min(ctb, ctw) << endl;
}
