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