#include <bits/stdc++.h>
using namespace std;
const int c_YET = -1;
const int INF = 1e9 + 1;
const long long LLINF = 1e17 + 1;
const int DX[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0};
const int DY[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0};
const long long MOD = 1e9 + 7;
const long long MAX = 1e9;
const double PI = 3.14159265358979323846264338327950288;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(30);
  long long N;
  string S;
  cin >> N >> S;
  long long ans = LLINF;
  vector<long long> to_white(N);
  to_white[0] = S[0] == '#';
  for (int i = 1; i < N; i++) {
    to_white[i] = to_white[i - 1] + (S[i] == '#');
  }
  vector<long long> to_black(N);
  to_black[N - 1] = S[N - 1] != '#';
  for (int i = N - 2; i >= 0; i--) {
    to_black[i] = to_black[i + 1] + (S[i] != '#');
  }
  long long first_black = -1;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      first_black = i;
      break;
    }
  }
  if (first_black == -1) {
    cout << 0 << endl;
    return 0;
  }
  to_black.emplace_back(0);
  for (int i = 0; i < N; i++) {
    ans = min(ans, to_white[i] + to_black[i + 1]);
  }
  cout << ans;
}
