#include <bits/stdc++.h>
using namespace std;
int dp[200001] = {0};
int main() {
  int N;
  string str;
  cin >> N >> str;
  for (int i = 0; i < N; i++) {
    if (str[i] == '.') {
      for (int k = i; k >= 0; k--) dp[k]++;
    } else {
      for (int k = i + 1; k <= N; k++) dp[k]++;
    }
  }
  int ans = N + 1;
  for (int i = 0; i <= N; i++) ans = min(dp[i], ans);
  cout << ans << endl;
  return 0;
}
