#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  string S;
  cin >> S;
  string S1 = S;
  int counta = 0;
  int countb = 0;
  for (int i = 0; i < N; ++i) {
    if (S[i] == '#' && S[i + 1] == '.') {
      S[i + 1] = '#';
      ++counta;
    }
  }
  for (int i = N; i > 0; --i) {
    if (S1[i - 1] == '#' && S1[i] == '.') {
      S1[i - 1] = '.';
      ++countb;
    }
  }
  if (counta < countb)
    cout << counta << endl;
  else
    cout << countb << endl;
}
