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