#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 2147483647;
const ll MOD = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int left = -1, right = -1;
  for (int i = 0; i < int(s.size()); ++i) {
    if (s[i] == '#') {
      left = i;
      break;
    }
  }
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '.') {
      right = i;
      break;
    }
  }
  if (left == -1 || right == -1) {
    cout << 0 << endl;
    return 0;
  }
  int white = 0;
  int black = 0;
  for (int i = left; i < right; i++) {
    if (s[i] == '#') black++;
    if (s[i] == '.') white++;
  }
  cout << min(white, black) << endl;
  return 0;
}
