#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int b = 0, w = 0;
  string temp = S;
  for (int i = 0; i < N - 1; i++) {
    if (temp[i] == '#' and temp[i + 1] == '.') {
      temp[i + 1] = '#';
      b++;
    }
  }
  temp = S;
  for (int i = N - 1; i > 0; i--) {
    if (temp[i] == '.' and temp[i - 1] == '#') {
      temp[i + 1] = '.';
      w++;
    }
  }
  cout << min(b, w) << '\n';
}
