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