#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, black, white, head = 0, tale = 0, sum = 0;
  string S;
  cin >> N >> S;
  while (S[head] == '.' && head < N) head++;
  tale = head + 1;
  while (tale < N) {
    while (S[tale] == '#') tale++;
    black = tale - head;
    head = tale;
    while (S[tale] == '.') tale++;
    white = tale - head;
    head = tale;
    sum += ((black) < (white)) ? (black) : (white);
  }
  cout << (sum) << endl;
  return 0;
}
