#include <bits/stdc++.h>
int main(int argc, const char* argv[]) {
  unsigned int n = 0, i = 0, j = 0, cnt1 = 0, cnt2 = 0;
  scanf("%u", &n);
  char s[2 * 100000];
  scanf("%s", s);
  while (s[j] != '#') {
    j++;
  }
  cnt2++;
  for (i = j; i < n; i++) {
    if (s[i] == '#') {
      cnt2++;
    } else {
      cnt1++;
    }
  }
  if (cnt1 < cnt2) {
    printf("%u", cnt1);
  } else {
    printf("%u", cnt2);
  }
  return 0;
}
