#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, countA, countB;
  string S, T;
  cin >> N >> S;
  countA = 0;
  countB = 0;
  T = S;
  for (int i = 0; i < N - 1; i++) {
    if (T[i] == '#' && T[i + 1] == '.') {
      T[i + 1] = '#';
      countA++;
    }
  }
  T = S;
  for (int i = N - 1; i > 0; i--) {
    if (T[i] == '.' && T[i - 1] == '#') {
      T[i - 1] = '.';
      countB++;
    }
  }
  cout << min(countA, countB) << endl;
  return 0;
}
