#include <bits/stdc++.h>
int MIN(int x, int y) { return x < y ? x : y; }
int main(void) {
  int n;
  scanf("%d", &n);
  char s[n + 2];
  scanf("%s", s);
  s[n + 1] = '#';
  int tmp = 0;
  int ans = 0;
  for (int i = 0; i < n + 1; i++) {
    if (s[i] == '.')
      tmp++;
    else {
      ans += tmp;
      tmp = 0;
    }
  }
  ans += tmp;
  tmp = 0;
  int ans2 = 0;
  for (int i = 0; i < n + 1; i++) {
    if (s[i] == '#')
      tmp++;
    else {
      ans2 += tmp;
      tmp = 0;
    }
  }
  ans2 += tmp;
  ans = MIN(ans, ans2);
  printf("%d", ans);
  return 0;
}
