#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int sames[N];
  int sameclasses;
  int temp = 0;
  int temp_class = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i + 1] == S[i])
      temp += 1;
    else {
      sames[temp_class] = temp;
      temp_class += 1;
      temp = 0;
    }
  }
  sames[temp_class] = temp;
  for (int i = 0; i <= temp_class; i++) sames[i] += 1;
  if (temp_class == 0) {
    cout << 0;
    return 0;
  }
  int num1 = 0;
  int num1_last;
  int num2 = 0;
  int num2_last;
  for (int i = 0; i <= temp_class; i += 2) {
    num1 += sames[i];
    num1_last = sames[i];
  }
  for (int i = 1; i <= temp_class; i += 2) {
    num2 += sames[i];
    num2_last = sames[i];
  }
  int replacenum = 0;
  if (num1 >= num2 && S[0] == '#')
    replacenum = num2;
  else if (num1 <= num2 && S[0] == '.')
    replacenum = num1;
  else if (num1 >= num2 && S[0] == '.') {
    replacenum = num2 - num2_last;
  } else {
    replacenum = num1 - num1_last;
  }
  cout << replacenum;
  return 0;
}
