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