#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char s[256];
  cin >> n >> s;
  char s1[256];
  char s2[256];
  for (int i = 0; i < n; i++) {
    s1[i] = s[i];
    s2[i] = s[i];
  }
  int i, j;
  int ans1 = 0;
  int ans2 = 0;
  for (i = 0; i < n; i++) {
    if ((s1[i] == '#') && (s1[i + 1] == '.')) {
      s1[i + 1] = '#';
      ans1 += 1;
    }
  }
  for (j = 0; j < n; j++) {
    if ((s2[j] == '#') && (s2[j + 1] == '.')) {
      s2[j] = '.';
      ans2 += 1;
    }
  }
  if (ans1 <= ans2) {
    cout << ans1 << endl;
  } else if (ans1 > ans2) {
    cout << ans2 << endl;
  }
  return 0;
}
