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