#include <bits/stdc++.h>
int main() {
  long N;
  scanf("%ld", &N);
  char S[N + 1];
  scanf("%s", S);
  S[N] = '\0';
  long cnt = -1;
  for (long i = 0; i < N; i++) {
    if (S[i] == '#') {
      cnt = i;
      break;
    }
  }
  long ans = 0;
  for (long i = cnt; i < N; i++) {
    if (S[i] == '.') {
      ans++;
    }
  }
  if (cnt == -1) {
    ans = 0;
  }
  if (cnt < N / 2) {
    ans = N - ans;
  }
  printf("%ld\n", ans);
  return 0;
}
