#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> w(N + 1, 0), b(N + 1, 0);
  for (int i = 0; i < N; i++) {
    if (S[i] == '.') {
      w[i + 1] = w[i] + 1;
      b[i + 1] = b[i];
    } else {
      w[i + 1] = w[i];
      b[i + 1] = b[i] + 1;
    }
  }
  int ans = INF;
  for (int i = 0; i < N; i++) {
    int tmp = 0;
    tmp += b[i + 1];
    tmp += w[N] - w[i + 1];
    ans = min(ans, tmp);
  }
  cout << ans << endl;
}
