#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int w = 0, b = 0;
  for (int i = 0; i < N; i++) {
    if (S.substr(i, 1) == "." && i != 0) {
      w++;
    } else if (S.substr(i, 1) == "#" && i != N - 1) {
      b++;
    }
  }
  if (S.substr(0, 1) != "#" && w == N - 1 ||
      S.substr(N, 1) != "." && b == N - 1) {
    cout << 0 << endl;
  } else if (w <= b) {
    cout << w << endl;
  } else {
    cout << b << endl;
  }
}
