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