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