#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int N;
  string S;
  cin >> N;
  cin >> S;
  int black_index = 0;
  int white_index = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '#') {
      black_index = i;
      break;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    if (S[S.size() - 1 - i] == '.') {
      white_index = S.size() - 1 - i;
      break;
    }
  }
  int min_toblack = 0;
  int min_towhite = 0;
  for (int i = black_index; i < S.size(); i++) {
    if (S[i] == '.') {
      min_toblack++;
    }
  }
  for (int i = 0; i < S.size(); i++) {
    if (S[S.size() - 1 - i] == '#') {
      min_towhite++;
    }
  }
  if (min_toblack < min_towhite) {
    cout << min_toblack;
  } else {
    cout << min_towhite;
  }
  return 0;
}
