#include <bits/stdc++.h>
int main(void) {
  int black = 0;
  int white = 0;
  int ans;
  int n;
  char s[2 * 10 * 10 * 10 * 10 * 10];
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') black++;
    if (s[i] == '.') white++;
  }
  int k = white;
  black = white = 0;
  for (int i = 0; i < k; i++) {
    if (s[i] == '#') black++;
  }
  for (int i = k; i < n; i++) {
    if (s[i] == '.') white++;
  }
  ans = black + white;
  if (ans > n) ans = n;
  printf("%d\n", ans);
  return 0;
}
