#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = INT_MAX;
  string s;
  cin >> n >> s;
  vector<int> v(n + 1, 0);
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') v[i + 1]++;
    v[i + 1] += v[i];
  }
  if (v[n + 1] == n) {
    cout << 0 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    ans = min(ans, v[n] + i - v[i] * 2);
  }
  cout << ans << endl;
  return 0;
}
