#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int black = 0, white = 0, ans = 0;
  for (int i = 0; i < N; i++) {
    (S[i] == '#') ? black++ : white++;
    i++;
  }
  if (white < black) {
    for (int i = 1; i < N; i++) {
      if (S[i - 1] == '#' && S[i] == '.') {
        ans++;
        S[i] = '#';
      }
    }
  } else {
    for (int i = N - 2; i = 0; i--) {
      if (S[i + 1] == '.' && S[i] == '#') {
        ans++;
        S[i] = '.';
      }
    }
  }
  cout << ans << endl;
}
