#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cnt = 0;
  int wcnt = 0;
  bool white = false;
  bool black = false;
  for (int i = (int)0; i < (int)n; ++i) {
    if (s[i] == '#') black = true;
    if (black) {
      if (s[i] == '.') cnt++;
      if (s[i] == '#') {
        wcnt++;
        if (i == n - 1) wcnt--;
      }
    }
  }
  int ans = min(cnt, wcnt);
  cout << ans << endl;
  return 0;
}
