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