#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  string S;
  cin >> S;
  int cntw = 0, cntb = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.')
      cntw++;
    else
      cntb++;
  }
  int cntlw = 0, cntrb = 0;
  for (int i = 0; i < S.size(); i++) {
    if (S[i] == '.')
      cntlw++;
    else
      break;
  }
  for (int i = S.size() - 1; i >= 0; --i) {
    if (S[i] == '#')
      cntrb++;
    else
      break;
  }
  int ans = min(cntw - cntlw, cntb - cntrb);
  cout << ans << endl;
  return 0;
}
