#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t = 0, result = 0;
  int wb_num[200000], wb_col, wb = 0;
  int calc[100000];
  string s;
  cin >> n;
  cin >> s;
  if (s[0] == '.')
    wb_col = 0;
  else
    wb_col = 1;
  wb_num[0] = 1;
  for (int i = 1; i < n; i++) {
    if (s[i] != s[i - 1]) wb++;
    wb_num[wb]++;
  }
  if (wb_col == 0) {
    for (int a = 0; a <= wb; a += 2) {
      for (int b = 1; b <= a; b += 2) calc[t] += wb_num[b];
      for (int b = a + 2; b <= wb; b += 2) calc[t] += wb_num[b];
      t++;
    }
  } else {
    for (int a = 1; a <= wb; a += 2) {
      for (int b = 0; b <= a; b += 2) calc[t] += wb_num[b];
      for (int b = a + 2; b <= wb; b += 2) calc[t] += wb_num[b];
      t++;
    }
  }
  result = calc[0];
  for (int i = 1; i < t; i++) {
    if (calc[i] < result) result = calc[i];
  }
  cout << result << endl;
  return 0;
}
