#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MOD = 1e9 + 7;
const ll INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string t = s;
  int b = 0;
  for (int i = 0; i < n - 1; i++) {
    if (t[i] == '#' and t[i + 1] == '.') {
      b++;
      t[i + 1] = '#';
    }
  }
  reverse(s.begin(), s.end());
  int w = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '.' and s[i + 1] == '#') {
      w++;
      s[i + 1] = '.';
    }
  }
  cout << min(b, w) << endl;
  return 0;
}
