#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k = 0, l = 0, q, w;
  string str, str1;
  cin >> n >> str;
  str1 = str;
  q = str.find('#');
  w = str1.find('.');
  if (q != -1) {
    for (int i = q; i < n; i++) {
      if (str[i] == '.') {
        ++k;
      }
    }
  } else {
    k = 1000000;
  }
  if (w != -1) {
    for (int i = w; i >= 0; i--) {
      if (str1[i] == '#') {
        ++l;
      }
    }
  } else {
    l = 1000000;
  }
  cout << min(k, l);
  return 0;
}
