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