#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  string S;
  cin >> S;
  long long res = 0;
  long long cnt = 0;
  long long K = 0;
  for (long long i = 0; i < N; i++) {
    if (S.at(i) == '#') {
      K = i;
      break;
    }
  }
  for (long long i = K; i < N; i++) {
    if (S.at(i) == '#')
      res++;
    else
      cnt++;
  }
  long long ans = min(res, cnt);
  cout << ans << endl;
}
