#include <bits/stdc++.h>
using namespace std;
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int b = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') b++;
  }
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#')
      s[i] = 'a';
    else if (s[i] == '.')
      break;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      s[i] = 'a';
    else if (s[i] == '#')
      break;
  }
  if (b == 0 || b == n) {
    cout << 0 << endl;
  } else {
    int b = 0, w = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '.')
        b++;
      else if (s[i] == '#')
        w++;
    }
    cout << min(b, w) << endl;
  }
  return 0;
}
