#include <bits/stdc++.h>
using namespace std;
int n;
char s[100000];
int jin[100000], dian[100000];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s[i];
    dian[i] = dian[i - 1];
    jin[i] = jin[i - 1];
    if (s[i] == '.')
      dian[i]++;
    else
      jin[i]++;
  }
  int minn = 1e9;
  for (int i = 0; i <= n; i++) {
    int left, right;
    left = jin[i];
    right = dian[n] - dian[i];
    minn = min(minn, left + right);
  }
  cout << minn << endl;
  return 0;
}
