#include <bits/stdc++.h>
using namespace std;
template <class T>
void GETV(T &v) {
  for (int((i)) = (0); ((i)) < ((v.size())); ((i))++) {
    cin >> (v[i]);
  }
}
template <class T>
void SHOWV(T &v) {
  for (int((i)) = (0); ((i)) < ((v.size())); ((i))++) {
    cout << (v[i]) << endl;
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int white = 0;
  int black = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      white++;
    } else {
      black++;
    }
  }
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i < white; i++) {
    if (s[i] == '#') {
      cnt1++;
    }
  }
  for (int i = n - 1; i > n - black - 1; i--) {
    if (s[i] == '.') {
      cnt2++;
    }
  }
  int ans1 = white > black ? black : white;
  if (cnt1 + cnt2 > 0) {
    if (ans1 > (cnt1 < cnt2 ? cnt1 : cnt2)) {
      cout << (cnt1 < cnt2 ? cnt1 : cnt2) << endl;
    } else {
      cout << ans1 << endl;
    }
  } else {
    cout << 0 << endl;
  }
  return 0;
}
