#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int b = 0, w = 0;
  int whc = 0;
  string S;
  cin >> N >> S;
  if (S[0] == '.') whc++;
  if (S[N - 1] == '#') whc = whc + 2;
  if (whc == 0) {
    for (int i = 0; i < N; i++) {
      if (S[i] == '.') w++;
      if (S[i] == '#') b++;
    }
  }
  if (whc == 1) {
    for (int i = 1; i < N; i++) {
      if (S[i] == '.') w++;
      if (S[i] == '#') b++;
    }
  }
  if (whc == 2) {
    for (int i = 0; i < N - 1; i++) {
      if (S[i] == '.') w++;
      if (S[i] == '#') b++;
    }
  }
  if (whc == 3) {
    for (int i = 1; i < N - 1; i++) {
      if (S[i] == '.') w++;
      if (S[i] == '#') b++;
    }
  }
  if (b > w) {
    cout << w << endl;
  } else {
    cout << b << endl;
  }
  return 0;
}
