#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  int cw, cb;
  cw = 0;
  cb = 0;
  int find = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      find = i;
      break;
    }
  }
  for (int i = find + 1; i < N; i++) {
    if (S.at(i) == '.') {
      cw++;
    }
  }
  reverse(S.begin(), S.end());
  int find2 = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      find2 = i;
      break;
    }
  }
  for (int i = find2 + 1; i < N; i++) {
    if (S.at(i) == '#') {
      cb++;
    }
  }
  cout << min(cw, cb) << endl;
}
