#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<int> B(N + 1, 0);
  for (int i = 0; i < N; i++) {
    if (S[i] == '#')
      B[i + 1] = B[i] + 1;
    else
      B[i + 1] = B[i];
  }
  int ans = 10000000;
  for (int i = 0; i < N; i++) {
    ans = min(ans, B[i + 1] + ((N - 1 - i) - (B[N] - B[i + 1])));
  }
  cout << ans << endl;
}
