#include <bits/stdc++.h>
int main(void) {
  int n, i = 0, ans = 0, cntd = 0, cnts = 0, f = 0;
  char s[10 * 10 * 10 * 10 * 10 * 10];
  scanf("%d", &n);
  scanf("%s", s);
  while (s[i] != '\0') {
    if (s[i] == '#' && f == 0) cnts++;
    if (s[i] == '.' && f == 1) cntd++;
    if (s[i] == '#' && s[i + 1] == '.') {
      f = 1;
    }
    if (f == 1 && s[i] == '#') {
      if (cntd > cnts)
        ans = ans + cnts + 1;
      else
        ans = ans + cntd + 1;
      f = 0;
      cntd = 0;
      cnts = 0;
    }
    i++;
  }
  printf("%d\n", ans);
  return 0;
}
