#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0, b = n - 1;
  while (a < n && s.at(a) != '#') a++;
  while (b >= 0 && s.at(b) != '.') b--;
  int blak = 0, whit = 0;
  for (int i = a + 1; i < n; i++) {
    if (s.at(i) == '.') whit++;
  }
  for (int i = b - 1; i >= 0; i--) {
    if (s.at(i) == '#') blak++;
  }
  cout << min(blak, whit) << endl;
  return 0;
}
