#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 5;
char second[MAXN];
int main() {
  int n, w = 0, b = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %c", &second[i]);
    if (second[i] == '.')
      w++;
    else
      b++;
  }
  for (int i = 0; i < n; i++) {
    if (second[i] == '.') {
      w--;
    } else {
      break;
    }
  }
  printf("%d", min(w, b));
}
