#include <bits/stdc++.h>
using namespace std;
int main(int argc, char* argv[]) {
  int N;
  string S;
  cin >> N >> S;
  int white_to_black_n = 0, black_to_white_n = 0;
  const char WHITE = '.';
  const char BLACK = '#';
  for (int i = 1; i < S.size(); ++i) {
    if (S[i - 1] == BLACK && S[i] == WHITE) {
      white_to_black_n++;
      S[i] = BLACK;
    }
  }
  cout << white_to_black_n << endl;
  return 0;
}
