#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  string t;
  cin >> s;
  t = s;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '.' && s[i - 1] == '#') {
      s[i] = '#';
      ans++;
    }
  }
  int tmp = 0;
  for (int i = 0; i < n; i++) {
    if (t[i] == '#') tmp++;
  }
  cout << min(ans, tmp) << endl;
}
