#include <bits/stdc++.h>
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 r = nw;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '.')
      r--;
    else
      r++;
    r = min(nw, r);
  }
  cout << r << endl;
}
