#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N >> S;
  reverse((S).begin(), (S).end());
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') {
      S[i] = '.';
    } else {
      break;
    }
  }
  int cnta = 0;
  int cntb = 0;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') cnta++;
    if (S[i] == '.') cntb++;
  }
  cout << min(cnta, cntb) << endl;
}
