#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, start;
  string S;
  cin >> N >> S;
  bool end = true;
  start = 0;
  if (N == 1) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      continue;
    }
    start = i;
    end = false;
    break;
  }
  if (end) {
    cout << 0 << endl;
    return 0;
  }
  int cc;
  int sc;
  if (S[S.size()] == '.') {
    cc = 0;
    sc = 1;
    for (int i = start + 1; i < N; i++) {
      if (S[i] == '.') {
        cc++;
        continue;
      }
      sc++;
    }
    cout << min(cc, sc) << endl;
    return 0;
  } else {
    cc = 0;
    sc = 1;
    int endc = N - 1;
    for (int i = N - 1; i > start; i--) {
      if (S[i] == '#') {
        continue;
      }
      endc = i;
      break;
    }
    for (int i = start + 1; i < endc; i++) {
      if (S[i] == '.') {
        cc++;
        continue;
      }
      sc++;
    }
    cout << min(cc, sc) << endl;
    return 0;
  }
}
