#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int start = S.find('#');
  int black = count(S.begin() + start, S.end() - 1, '#');
  int white = count(S.begin() + start, S.end(), '.');
  if (black <= white) {
    cout << black << endl;
  } else {
    cout << white << endl;
  }
  return 0;
}
