#include <bits/stdc++.h>
using namespace std;
constexpr char white = '.';
constexpr char black = '#';
int main() {
  int len;
  string str;
  cin >> len >> str;
  int firstblack = len;
  for (int i = 0; i < len; ++i) {
    if (str[i] == black) {
      firstblack = i;
      break;
    }
  }
  int numWhite = 0;
  int numBlack = 0;
  for (int i = firstblack; i < len; ++i) {
    if (str[i] == white)
      ++numWhite;
    else
      ++numBlack;
  }
  cout << min(numWhite, numBlack) << endl;
}
