#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, cnt, cntw, len, est;
  cin >> n;
  cnt = 0;
  cntw = 0;
  string str;
  cin >> str;
  for (int m = 0; m < n; m++) {
    if (str[m] == '.') {
      str.erase(str.begin());
      m = m - 1;
    } else {
      break;
    }
  }
  len = str.size();
  for (int j = len - 1; j > 0; j--) {
    if (str[j] == '#') {
      str.pop_back();
    } else {
      break;
    }
  }
  len = str.size();
  for (int i = 0; i < len; i++) {
    if (str[i] == '#') {
      cnt++;
    } else {
      cntw++;
    }
  }
  est = min(cnt, cntw);
  cout << est << endl;
}
