#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  int KURO[200010];
  int SHIRO[200010];
  int CHA[200010];
  char S1[200010];
  cin >> N;
  cin >> S1;
  if (S1[0] == '.') {
    SHIRO[0] += 1;
  } else {
    KURO[0] += 1;
  }
  if (S1[0] != S1[1]) {
    CHA[0] = 1;
  }
  for (int i = 1; i < N; i++) {
    SHIRO[i] = SHIRO[i - 1];
    KURO[i] = KURO[i - 1];
    if (S1[i] == '.') {
      SHIRO[i] += 1;
    } else {
      KURO[i] += 1;
    }
    if (S1[i] != S1[i + 1]) {
      CHA[i] = 1;
    }
  }
  int he = 0;
  for (int i = N - 1; i >= 0; i--) {
    if (CHA[i] == 1) {
      if (KURO[i] < SHIRO[i]) {
        he = i;
      }
    }
  }
  int ANS;
  if (he == 0) {
    ANS = SHIRO[N - 1];
  } else if (he == N - 1) {
    ANS = KURO[N - 1];
  } else {
    ANS = KURO[he] + SHIRO[N - 1] - SHIRO[he];
  }
  cout << ANS << endl;
  return 0;
}
