#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, count1 = 0, count2 = 0;
  string s1, s2;
  cin >> n >> s1;
  s2 = s1;
  for (int i = 0; i < n - 1; i++) {
    if (s1[i] == '#' && s1[i + 1] == '.') {
      count1++;
      s1[i + 1] = '#';
    }
    if (s2[i] == '#' && s2[i + 1] == '.') {
      count2++;
      s2[i] = '.';
    }
  }
  cout << min(count1, count2) << endl;
  return 0;
}
