#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int b = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(n - 1 - i) == '.')
      w++;
    else
      b++;
  }
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.')
      w--;
    else
      break;
  }
  for (int i = 0; i < n; i++) {
    if (s.at(n - 1 - i) == '#')
      b--;
    else
      break;
  }
  if (b >= w) {
    if (w)
      cout << w << endl;
    else
      cout << 0 << endl;
  } else {
    if (b)
      cout << b << endl;
    else
      cout << 0 << endl;
  }
}
