#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  string s;
  int n;
  cin >> n >> s;
  int nw = (s[s.size() - 1] == '.') ? 1 : 0;
  int nb = (s[0] == '#') ? 1 : 0;
  for (size_t i = 1; i < s.size() - 1; i++) {
    if (s[i] == '.')
      nw++;
    else
      nb++;
  }
  cout << min(nb, nw) << endl;
  return 0;
}
