#include <bits/stdc++.h>
using namespace std;
const long int MOD = pow(10, 9) + 7;
int main() {
  int n;
  cin >> n;
  int count = 0;
  char c;
  char c0, cn;
  for (int i = 0; i < n; ++i) {
    cin >> c;
    if (c == '#') count++;
    if (i == 0) c0 = c;
    if (i == n - 1) cn = c;
  }
  if (count > n / 2.0) {
    if (c0 == '.') {
      cout << n - count - 1 << endl;
    } else {
      cout << n - count << endl;
    }
  } else {
    if (cn == '#') {
      cout << count - 1 << endl;
    } else {
      cout << count << endl;
    }
  }
  return 0;
}
