#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int i;
  for (i = 0; i < N; ++i)
    if (S[i] == '#') break;
  int b = 0, w = 0;
  for (; i < N; ++i) {
    if (S[i] == '#') b++;
    if (S[i] == '.') w++;
  }
  cout << (b < w ? b : w) << endl;
  return 0;
}
