#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int white = 0;
  int black = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      white++;
    } else {
      black++;
    }
  }
  int x_white = 0;
  int x_black = 0;
  int ans = N;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == '.') {
      x_white++;
    } else {
      x_black++;
    }
    ans = min(ans, x_black + (white - x_white));
  }
  cout << ans << endl;
}
