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