#include <bits/stdc++.h>
int main() {
  int N;
  scanf("%d", &N);
  char S[N + 1];
  scanf("%s", &S);
  uint32_t count1 = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#') {
      if (S[i + 1] == '.') {
        count1++;
      }
    }
  }
  uint32_t count2 = 0;
  for (int i = 1; i < N; i++) {
    if (S[i] == '.') {
      if (S[i - 1] == '#') {
        count2++;
      }
    }
  }
  if (count1 >= count2) {
    printf("%d", count1);
  } else {
    printf("%d", count2);
  }
  return 0;
}
