#include <bits/stdc++.h>
int min(int a, int b) {
  if (a < b) {
    return a;
  }
  return b;
}
int main(void) {
  int N;
  scanf("%d", &N);
  char S[N];
  scanf("%s", S);
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') cnt1++;
    if (i == N - 1) break;
    if (S[i] == '#') cnt2++;
  }
  printf("%d\n", min(cnt1, cnt2));
  return 0;
}
