#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> cnt1(n + 1);
  vector<int> cnt2(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (a[i] == '.')
      cnt1[i + 1] = 1;
    else
      cnt2[i + 1] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    cnt1[i] += cnt1[i - 1];
    cnt2[i] += cnt2[i - 1];
  }
  int ans = n;
  for (int i = 1; i <= n; ++i) {
    ans = min(ans, cnt1[i] + cnt2[n] - cnt2[i - 1]);
  }
  cout << ans;
  return 0;
}
