#include <bits/stdc++.h>
using namespace std;
string s = "";
int n;
int ansblack = 0, answhite = 0;
int main() {
  cin >> n;
  cin >> s;
  int res = s.find('#');
  if (res > -1) {
    for (int i = (int)(res); i < (int)(n); ++i) {
      if (s.substr(i, 1) == ".") ansblack++;
    }
  }
  res = s.find_last_of('.');
  if (res > -1) {
    for (int i = (int)(res + 1) - 1; i >= (int)(0); --i) {
      if (s.substr(i, 1) == "#") answhite++;
    }
  }
  cout << min(ansblack, answhite) << endl;
  return 0;
}
