#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char str[200001];
  fflush(stdin);
  scanf("%s", str);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == '#') {
      int black = 0, white = 0;
      while (str[i] == '#') {
        i++;
        black++;
      }
      while (str[i] == '.') {
        i++;
        white++;
      }
      cnt += (black < white ? black : white);
      i--;
    }
  }
  cout << cnt;
  system("pause");
  return 0;
}
