#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int n;
  string s;
  int res = 0, ans = 0;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') res++;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '.')
      ans--;
    else
      ans++;
    ans = min(ans, res);
  }
  cout << ans << endl;
}
