#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int i = 0;
  while (S[i] == '.') {
    ++i;
  }
  int j = N - 1;
  while (S[j] == '#') {
    --j;
  }
  string T = S.substr(i, j - i + 1);
  int white = count(T.begin(), T.end(), '.');
  int black = count(T.begin(), T.end(), '#');
  cout << min(white, black) << endl;
}
