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