#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int min = 2 * 10 ^ 2;
  int count = 0;
  char old_s = s[0];
  for (int i = 1; i < n; ++i) {
    if (old_s == '#' && s[i] == '.') {
      count += 1;
      old_s = '#';
    } else {
      old_s = s[i];
    }
  }
  min = count;
  count = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '#') {
      count += 1;
    }
  }
  if (count < min) min = count;
  count = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      count += 1;
    }
  }
  if (count < min) min = count;
  cout << min << endl;
}
