#include <iostream>
#include <string>

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