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