#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  bool wflg = false, bflg = false;
  int w = 0, b = 0;
  for (auto i = 0; i < n; i++) {
    if (s[i] == '#')
      bflg = true;
    else
      wflg = true;
    if (bflg and s[i] == '.') w++;
    if (wflg and s[i] == '#') b++;
  }
  cout << min(w, b) << endl;
  return 0;
}
