#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  vector<int> sum(N + 1);
  for (int i = 0; i < N; i++) {
    sum[i + 1] = sum[i] + (S[i] == '.');
  }
  int ans = 9999;
  if (sum[N] == 0) {
    cout << "0\n";
    return 0;
  }
  for (int i = 0; i < N; i++) {
    int tmp = 0;
    tmp = i + 1 - sum[i + 1];
    tmp += sum[N] - sum[i + 1];
    ans = min(ans, tmp);
  }
  cout << ans << "\n";
  return 0;
}
