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