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