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