#include <bits/stdc++.h>
int main() {
  int i, n, b, w, a;
  char s[200001];
  scanf("%d", &n);
  scanf("%s", s);
  b = w = a = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '.') continue;
    for (; s[i] == '#'; i++) b++;
    if (s[i] == '\0') break;
    for (; s[i] == '.'; i++) w++;
    if (s[i] == '\0') break;
    if (w < b)
      a += w;
    else
      a += b;
    w = b = 0;
  }
  if (w < b)
    a += w;
  else
    a += b;
  printf("%d\n", a);
  return 0;
}
