#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
  int count;
  char stone[200000];
  int ans = 0;
  scanf("%d", &count);
  scanf("%s", stone);
  for (int i = 1; i < count; i++) {
    if (stone[i - 1] == '#' && stone[i] == '.') ans++;
  }
  printf("%d\n", ans);
}
