#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  string t = s;
  int cnt = 0;
  int cnt2 = 0;
  for (int i = 1; i < n; i++) {
    if (t[i] == '.' && t[i - 1] == '#') {
      cnt++;
      t[i - 1] = '.';
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    if (s[i] == '#' && s[i + 1] == '.') {
      cnt2++;
      s[i + 1] = '#';
    }
  }
  cout << min(cnt, cnt2) << "\n";
}
