#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, minn = 500000, numa = 0, numb = 0;
  string s;
  bool juda = false, judb = false;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (juda == false) {
      if (s[i] == '#') {
        juda = true;
      }
    } else {
      if (s[i] == '.') numa++;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (judb == false) {
      if (s[i] == '.') {
        judb = true;
      }
    } else {
      if (s[i] == '#') numb++;
    }
  }
  int ans = min(numa, numb);
  cout << ans << "\n";
  return 0;
}
