#include <bits/stdc++.h>
int main() {
  int n;
  std::string s, s_sub;
  std::cin >> n;
  std::cin >> s;
  int whitecnt = 0;
  int blackcnt = 0;
  s_sub = s.substr(0, n);
  for (int i = 0; i < n; i++) {
    if (s[i] != '.') {
      s_sub = s.substr(i, n - i);
      break;
    }
  }
  int ss;
  ss = s_sub.size();
  for (int i = ss - 1; i > 0; i--) {
    if (s[i] != '#') {
      s_sub = s_sub.substr(0, i + 1);
      break;
    }
  }
  ss = s_sub.size();
  for (int i = 0; i < ss; i++) {
    if (s_sub[i] == '.') {
      whitecnt++;
    } else {
      blackcnt++;
    }
  }
  if (whitecnt < blackcnt) {
    std::cout << whitecnt;
  } else {
    std::cout << blackcnt;
  }
  return 0;
}
