#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin >> N;
  string S;
  cin >> S;
  string black = "", white = "";
  for (int i = 0; i < N; ++i) {
    if (i + 1 < N && S[i] == '#' && S[i + 1] == '.') {
      black += '#';
      ++i;
      while (i < N && S[i] != '#') {
        black += '#';
        ++i;
      }
      --i;
      continue;
    }
    black += S[i];
  }
  for (int i = 0; i < N; ++i) {
    if (i + 1 < N && S[i] == '#' && S[i + 1] == '.') {
      white += '.';
      continue;
    }
    white += S[i];
  }
  int b = 0, w = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] != black[i]) ++b;
    if (S[i] != white[i]) ++w;
  }
  cout << min(w, b) << "\n";
  return 0;
}
