#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int cnt_black = 0, cnt_white = 0;
  for (int i = 0; i < n; i++) {
    if (s.at(i) == '#')
      cnt_black++;
    else
      cnt_white++;
  }
  if (s.at(0) == '.') {
    cnt_white--;
    for (int i = 0; i < n - 1; i++) {
      if (s.at(i) == '.' && s.at(i + 1) == '.') {
        cnt_white--;
      } else {
        break;
      }
    }
  }
  if (s.at(n - 1) == '#') {
    cnt_black--;
    for (int i = n - 1; i > 0; i--) {
      if (s.at(i) == '#' && s.at(i - 1) == '#') {
        cnt_black--;
      } else {
        break;
      }
    }
  }
  cout << min(cnt_black, cnt_white) << endl;
  return 0;
}
