#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int black = 0;
  string Sb = S;
  for (int i = 1; i < N; i++) {
    if (Sb[i - 1] == '#' && Sb[i] == '.') {
      Sb[i] = '#';
      black++;
    }
  }
  int white = 0;
  string Sw = S;
  for (int i = N - 1; i > 0; i--) {
    if (Sw[i - 1] == '#' && Sw[i] == '.') {
      Sw[i - 1] = '.';
      white++;
    }
  }
  cout << min(black, white) << endl;
  return 0;
}
