#include <bits/stdc++.h>
using namespace std;
long long cnt[224514];
signed main() {
  long long n;
  string s;
  cin >> n >> s;
  long long cnta = 0, cntb = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      cnta++;
    else
      cntb++;
  }
  for (int i = 1; i < n; i++) {
    if (s[i] == '.') cnt[i] = cnt[i - 1] + 1;
  }
  long long ans = 1e9 + 7;
  for (int i = 0; i < n; i++) ans = min(ans, i + 1 - cnt[i] + cnta - cnt[i]);
  cout << min({cnta, cntb, ans}) << endl;
  getchar();
  getchar();
  return 0;
}
