#include <bits/stdc++.h>
using namespace std;
signed main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int white = 0, black = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      ++white;
    } else {
      ++black;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') break;
    --white;
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S[i] == '.') break;
    --black;
  }
  cout << min(white, black) << endl;
  return 0;
}
