#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 + 1); i < (int)(n); ++i) {
      if (s[i] == '.') ansblack++;
    }
    res = s.find_last_of('#');
    for (int i = (int)(res + 1) - 1; i >= (int)(0); --i) {
      if (s[i] == '#') answhite++;
    }
  }
  cout << min(ansblack, answhite) << endl;
  return 0;
}
