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