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