#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  bool found = false;
  int b_count = 0;
  for (int i = 0; i < S.length(); i++) {
    if (!found) {
      if (S[i] == '#') {
        found = true;
      }
    } else {
      if (S[i] == '.') {
        b_count++;
      }
    }
  }
  int w_count = 0;
  for (int i = S.length() - 1; i >= 0; i--) {
    if (!found) {
      if (S[i] == '.') {
        found = true;
      }
    } else {
      if (S[i] == '#') {
        w_count++;
      }
    }
  }
  if (b_count < w_count) {
    cout << b_count << endl;
  } else {
    cout << w_count << endl;
  }
  return 0;
}
