#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  if (n == 1) {
    cout << 0 << endl;
    return 0;
  }
  int sharpcnt = 0, sharpchangecnt = 0, dotchangecnt = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '#') {
      sharpcnt++;
    } else {
      break;
    }
  }
  for (int i = 0; i < n - sharpcnt; ++i) {
    if (s[i] == '#') {
      sharpchangecnt++;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] == '.') {
      dotchangecnt++;
    }
  }
  cout << min(sharpchangecnt, dotchangecnt) << endl;
}
