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