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