#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, w = 0, b = 0, wflg = 0, bflg = 0;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.' && wflg == 0)
      continue;
    else {
      wflg = i;
      break;
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '#' && bflg == 0)
      continue;
    else {
      bflg = i;
      break;
    }
  }
  for (int i = wflg; i < bflg + 1; i++) {
    if (S[i] == '.') w++;
    if (S[i] == '#') b++;
  }
  if (w < b) {
    printf("%d\n", w);
  } else {
    printf("%d\n", b);
  }
}
