#include <bits/stdc++.h>
using namespace std;
int main(void){
  int N;
  string S;
  cin >> N >> S;
  int lb = 0;
  int rw = count(S.begin(), S.end(), '.');
  int ans = lb + rw;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      rw--;
    } else {
      lb++;
    }
    ans = min(ans, lb + rw);
  }
  cout << ans << endl;
}
