#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, res = 0;
  char cur, pre;
  scanf("%d\n", &n);
  scanf("%c", &pre);
  for (int i = 1; i < n; ++i) {
    scanf("%c", &cur);
    if (pre == '#' && cur == '.') ++res;
    pre = cur;
  }
  printf("%d", res);
  return 0;
}
