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