#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;
  int cnt = 1;
  int b = 0, w = 0;
  for (int i = 0; i < n - 1; i++) {
    if (s[i] == '#' and s[i + 1] == '#') cnt++;
    if (s[i] == '#' and s[i + 1] == '.') {
      int tmp = 0;
      i++;
      while (i < n and s[i] != '#') {
        tmp++;
        i++;
      }
      b += cnt;
      w += tmp;
      cnt = 1;
    }
  }
  cout << min(b, w) << endl;
  return 0;
}
