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