#include <bits/stdc++.h>
using namespace std;
const int INF = 101234567;
int main() {
  int N;
  int ans = INF;
  string S;
  cin >> N;
  cin >> S;
  vector<int> white_cnt(N + 1);
  vector<int> black_cnt(N + 1);
  int cnt_white = 0;
  int cnt_black = 0;
  white_cnt[0] = 0;
  black_cnt[0] = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.') {
      cnt_white++;
    } else {
      cnt_black++;
    }
    white_cnt[i + 1] = cnt_white;
    black_cnt[i + 1] = cnt_black;
  }
  if (cnt_white == N || cnt_black == N) {
    cout << 0 << endl;
    return 0;
  }
  int total;
  for (int i = 0; i < N; i++) {
    total = white_cnt[N] - white_cnt[i] + black_cnt[i];
    ans = min(ans, total);
  }
  cout << ans << endl;
}
