#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  string S;
  cin >> N >> S;
  int delL = 0;
  int delR = 0;
  int minDel = delL + delR;
  for (int i = 0; i < N; i++) {
    if (S[0] == '.') {
      delR = 0;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      delR--;
    } else {
      delL++;
    }
    minDel = min(minDel, delR + delL);
  }
  cout << minDel << endl;
  return 0;
}
