#include <bits/stdc++.h>
int main() {
  const int STR_LEN_MAX = 2 * std::pow(10, 5);
  int n;
  char s[STR_LEN_MAX];
  scanf("%d%s", &n, s);
  int white_1 = 0;
  int i = 0;
  while (i < (n - 1) && (s[n - i - 1] == s[n - i - 2])) {
    if (s[n - i - 1] == '.') white_1++;
    i++;
  }
  if (s[n - i - 1] == '.') white_1++;
  int white_2 = 0;
  int black_2 = 0;
  for (; i < n; i++) {
    if (s[n - i - 1] == '.') white_2++;
    if (s[n - i - 1] == '#') black_2++;
  }
  int res = 0;
  res = (white_2 < black_2) ? white_2 : black_2;
  res = (white_1 < black_2) ? white_1 : res;
  printf("%d", res);
}
