#include <bits/stdc++.h>
using namespace std;
const long long int INF = 2e18 + 99;
;
void FAST_IO();
int main() {
  int n;
  scanf("%d", &n);
  string s;
  cin >> s;
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
void FAST_IO() {}
