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