#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, cntw = 0, cntb = 0;
  bool flag = false;
  string S;
  cin >> N >> S;
  for (int i = 0; i < N; i++) {
    if (S[i] == '#') flag = true;
    if (flag == true) {
      if (S[i] = '.')
        cntw++;
      else
        cntb++;
    }
  }
  if ((cntw == 0) || (cntw == N))
    cout << "0" << endl;
  else if (cntw <= cntb)
    cout << cntw << endl;
  else
    cout << cntb << endl;
}
