#include <iostream>
#include <string>

using namespace std;
int main(){
  int n; cin >> n;
  string s; cin >> s;
  
  int nw = 0;
  for (int i=0; i<n; i++) if (s.at(i) == '.') nw++;
  int nwr=nw, nbl=0, r=nw;
  for (int i=0; i<n; i++) {
    if (s.at(i) == '.') nwr--;
    else nbl++;
    r = min(nwr+nbl, r);
  }
  cout << r << endl;
}
