#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  string str;
  cin >> n >> str;
  long long count = 0, count2 = 0;
  bool found = false;
  long long limit = n;
  long long start = 0;
  for (long long i = 0; (i < n); ++i) {
    if (str[i] != '.') {
      start = i;
      break;
    }
  }
  for (long long i = n - 1; (i >= 0); --i) {
    if (str[i] != '#') {
      limit = i + 1;
      break;
    }
  }
  for (long long i = start; (i < limit); ++i) {
    if (str[i] == '#') {
      count++;
    }
    if (str[i] == '.') {
      count2++;
    }
  }
  cout << min(count, count2) << endl;
  return 0;
}
