#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  long long D[2][n];
  D[0][0] = 0;
  D[1][0] = 0;
  if (s[0] == '#') {
    D[1][0]++;
  } else {
    D[0][0]++;
  }
  for (int i = 1; i < n; i++) {
    D[0][i] = 20000000000;
    D[1][i] = 20000000000;
    if (s[i] == '#') {
      D[0][i] = min(D[1][i - 1], D[0][i - 1]);
    } else {
      D[1][i] = min(D[1][i - 1], D[0][i - 1] + 1);
    }
  }
  cout << min(D[0][n - 1], D[1][n - 1]);
  return 0;
}
