#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i = 0, branco = 0, preto = 0, aux;
  char S[200010];
  scanf("%d %s", &N, S);
  while (S[i] == '.') i++;
  while (i < N) {
    aux = 0;
    while (S[i] == '#' and i < N) {
      i++;
      aux++;
    }
    if (i < N)
      preto += aux;
    else
      continue;
    branco++;
    i++;
  }
  if (branco < preto)
    cout << branco << endl;
  else
    cout << preto << endl;
  return 0;
}
