#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, w = 0, b = 0, flag = 0;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      flag = 1;
      b++;
    }
    if (flag)
      if (s[i] == '.') w++;
  }
  if (b > w)
    cout << w << "\n";
  else
    cout << b << "\n";
}
