#include <bits/stdc++.h>
int main() {
  int n, i = 0, sharp = 0, dot = 0;
  char s[200001];
  scanf("%d %s", &n, s);
  while (s[i] == '.') {
    i++;
  }
  while (s[i]) {
    if (s[i] == '.') {
      dot++;
    } else {
      sharp++;
    }
    i++;
  }
  i--;
  while (s[i] == '#') {
    sharp--;
    i--;
  }
  printf("%d", ((sharp < dot) ? (sharp) : (dot)));
  return 0;
}
