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