#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> vecB(N + 1), vecW(N + 1), ans(N + 1);
  for (int i = 0; i <= N; i++) {
    if (S[i] == '#') {
      vecB[i + 1] = vecB[i] + 1;
    } else {
    }
    if (S[N - 1 - i] == '.') {
      vecW[N - 2 - i] = vecW[N - 1 - i] + 1;
    } else {
    }
  }
  for (int i = 0; i < N; i++) {
    ans[i] = vecB[i] + vecW[i];
  }
  sort(ans.begin(), ans.end());
  cout << ans[0] << endl;
  return 0;
}
