#include <bits/stdc++.h>
int main() {
  int N;
  std::string S;
  std::cin >> N >> S;
  int res = 0;
  int blackCount = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      blackCount++;
    } else if (S[i] == '.') {
      if (blackCount >= 1) {
        res++;
        blackCount = 0;
      }
    }
  }
  std::cout << res << std::endl;
  return 0;
}
