#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  N = S.length();
  int totalWhite = 0;
  int totalBlack = 0;
  int black[N];
  int white[N];
  for (int i = 0; i < (int)(N); i++) {
    if (S[i] == '#') {
      totalBlack++;
    } else {
      totalWhite++;
    }
    black[i] = totalBlack;
    white[i] = totalWhite;
  }
  int ans = INT_MAX;
  for (int i = 0; i < (int)(N - 1); i++) {
    int leftBlack = black[i];
    int leftWhite = white[i];
    int rightBlack = totalBlack - black[i + 1];
    int rightWhite = totalWhite - white[i + 1];
    int allWhite = leftBlack + rightBlack;
    int turn = leftBlack + rightWhite;
    int allBlack = leftWhite + rightWhite;
    ans = min(ans, allWhite);
    ans = min(ans, allBlack);
    ans = min(ans, turn);
  }
  if (ans == INT_MAX) {
    cout << 0 << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}
