#include <bits/stdc++.h>
int main() {
  int N;
  std::string S;
  std::cin >> N >> S;
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#' && S[i + 1] == '.') {
      ++ans;
      if (1 <= i && i <= N - 3) {
        if (S[i - 1] == '#' && S[i + 2] == '.') {
          ++ans;
        }
      }
    }
  }
  std::cout << ans << "\n";
  return 0;
}
