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