#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int cntw = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') cntw++;
  }
  int cntb = n - cntw;
  int cntfw = 0;
  int cntlb = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') break;
    cntfw++;
  }
  for (int i = 0; i < n; i++) {
    if (s[n - 1 - i] == '.') break;
    cntlb++;
  }
  cout << min(cntw - cntfw, cntb - cntlb) << endl;
}
