#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void display_vec(vector<int> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  cout << endl;
}
int main(int argc, const char *argv[]) {
  int n;
  string s1, s2;
  cin >> n >> s1;
  s2 = s1;
  int cnt1 = 0;
  for (int i = 1; i < n; i++) {
    if (s1[i] == '.' && s1[i - 1] == '#') {
      s1[i] = '#';
      cnt1++;
    }
  }
  int cnt2 = 0;
  for (int i = n - 1; i > 0; i--) {
    if (s2[i] == '.' && s2[i - 1] == '#') {
      s2[i - 1] = '.';
      cnt2++;
    }
  }
  if (cnt1 < cnt2) {
    cout << cnt1 << endl;
  } else {
    cout << cnt2 << endl;
  }
}
