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