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