#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string s;
  cin >> n >> s;
  int i = 0, l = n, b = 0, x = 0;
  while (s[i] == '.') i++;
  for (int j = n - 1; j > -1; j--) {
    if (s[j] == '#')
      x++;
    else
      break;
  }
  l -= (i + x);
  n -= x;
  for (; i < n; i++) {
    if (s[i] == '#') b++;
  }
  cout << min(b, l - b) << endl;
  return 0;
}
