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