#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  cin >> N;
  cin >> S;
  string tmp;
  int ni;
  ni = N - 1;
  tmp = S.substr(ni, 1);
  int length;
  if (tmp == "#") {
    while (tmp == "#") {
      ni = ni - 1;
      if (ni >= 0) {
        tmp = S.substr(ni, 1);
      } else {
        tmp = "";
      }
    }
  }
  if (ni < 0) {
    cout << 0;
  } else {
    int ne;
    ne = 0;
    tmp = S.substr(ne, 1);
    while (tmp == ".") {
      ne = ne + 1;
      if (ne <= ni) {
        tmp = S.substr(ne, 1);
      } else {
        tmp = "";
      }
    }
    if (ne >= ni) {
      cout << 0;
    } else {
      length = ni + 1 - (ne + 1) + 1;
      int count_bk = 0;
      while (ni >= ne) {
        tmp = S.substr(ni, 1);
        if (tmp == "#") {
          count_bk = count_bk + 1;
        }
        ni = ni - 1;
      }
      int min;
      min = length - count_bk;
      if (min > count_bk) min = count_bk;
      cout << min;
    }
  }
}
