#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long inf = 1e18;
int main() {
  int n;
  cin >> n;
  vector<char> a(n);
  vector<int> cnt(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i] == '.') cnt[i] = 1;
    if (i != 0) cnt[i] += cnt[i - 1];
  }
  int ans = INT_MAX;
  for (int i = 0; i < n; ++i) {
    ans = min(ans, cnt[n - 1] - cnt[i] + i + 1 - cnt[i]);
  }
  cout << ans;
  return 0;
}
