#include <bits/stdc++.h>
int main(void) {
  int i, N, count = 0;
  char x, *a;
  scanf("%d", &N);
  a = new char[N];
  for (i = 0; i < N; i++) {
    scanf("%c", &x);
    if (x == '#')
      a[i] = 0;
    else
      a[i] = 1;
  }
  for (i = 1; i < N; i++) {
    if (a[i] < a[i - 1]) count += 1;
  }
  printf("%d\n", count);
  return 0;
}
