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