#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, x = 0, y = 0;
  int a;
  string s, rs;
  cin >> n >> s;
  rs = s;
  a = s.find('.');
  reverse(rs.begin(), rs.end());
  for (i = 0; i < s.length() - 1; i++) {
    if (s[i] == '#' && s[i + 1] == '.') {
      s[i + 1] = '#';
      x++;
    }
  }
  for (i = 0; i < rs.length() - a; i++) {
    if (rs[i] == '.' && rs[i + 1] == '#') {
      rs[i + 1] = '.';
      y++;
    }
  }
  if (x < y) {
    cout << x << endl;
  } else {
    cout << y << endl;
  }
  return 0;
}
