#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int ans = 1 << 30;
  string S;
  cin >> N >> S;
  vector<int> white(N + 1, 0);
  vector<int> black(N + 1, 0);
  for (int i = 1; i < N; i++) {
    white[i] = white[i - 1];
    black[i] = black[i - 1];
    if (S[i - 1] == '.')
      white[i]++;
    else
      black[i]++;
  }
  for (int i = 0; i <= N; i++) {
    int b = black[N] - black[i];
    int w = white[i] - white[0];
    ans = min(b + w, ans);
  }
  cout << abs(ans) << endl;
  return 0;
}
