#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long res = 1LL << 60;
  long long b = 0;
  long long w = 0;
  for (long long i = 0; i < N; ++i) {
    if (S[i] == '#')
      ++b;
    else
      ++w;
  }
  long long BL = 0;
  long long WR = w;
  for (long long i = 0; i < N; ++i) {
    if (S[i] == '#')
      ++BL;
    else
      --WR;
    res = min(res, BL + WR);
  }
  cout << res << endl;
}
