#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  int a = 0, b = 0;
  string t = s;
  for (int i = 1; i < n; i++) {
    if (t[i - 1] == '#' and t[i] == '.') {
      a++;
      t[i] = '#';
    }
  }
  for (int i = 1; i < n; i++) {
    if (s[i - 1] == '#' and s[i] == '.') {
      b++;
      s[i - 1] = '.';
    }
  }
  cout << min(a, b) << '\n';
  return 0;
}
