#include <bits/stdc++.h>
static void C_Stones();
int main() {
  C_Stones();
  fflush(stdout);
  return 0;
}
static void C_Stones() {
  static char stones[100004 * 2] = {0};
  int N = 0;
  scanf(" %d %s", &N, stones);
  bool foundBk = false;
  int bkCount = 0, bkCount2 = 0;
  int whtCount = 0, whtCount2 = 0;
  for (int i = 0; i < N; i++) {
    if (stones[i] == '#') {
      bkCount++;
    } else if ((stones[i] == '.') && (bkCount)) {
      whtCount++;
    }
    if (stones[N - 1 - i] == '.') {
      whtCount2++;
    } else if ((stones[N - 1 - i] == '#') && (whtCount2)) {
      bkCount2++;
    }
  }
  int cnt1 = (bkCount > whtCount) ? whtCount : bkCount;
  int cnt2 = (bkCount2 > whtCount2) ? whtCount2 : bkCount2;
  printf("%d\n", ((cnt1 > cnt2) ? cnt2 : cnt1));
}
