#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N;
  cin >> S;
  int wc = 0, bc = 0;
  bool start_counting = false;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      start_counting = true;
      bc++;
    }
    if (start_counting && S[i] == '.') wc++;
  }
  if (wc > bc)
    cout << bc << endl;
  else
    cout << wc << endl;
  return 0;
}
