#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int idx = 0;
  for (int i = (0); i < (N); ++i) {
    if (S[i] == '.') {
      idx = max(0, i - 1);
      break;
    }
  }
  S = S.substr(idx);
  int white_num = count(S.begin(), S.end(), '.');
  int black_num = count(S.begin(), S.end(), '#');
  int ans = min(white_num, black_num);
  cout << ans << endl;
  return 0;
}
