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