#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cb = 0, cw = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (s.at(i) == '.')
      cw++;
    else
      cb++;
  }
  for (int i = 0; i < (int)(n); i++) {
    if (s.at(i) == '.')
      cw--;
    else
      break;
  }
  reverse((s).begin(), (s).end());
  for (int i = 0; i < (int)(n); i++) {
    if (s.at(i) == '#')
      cb--;
    else
      break;
  }
  cout << min(0, min(cw, cb)) << endl;
  return 0;
}
