#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans1 = 0, ans2 = 0, ans;
  string s, sc;
  char m = '.';
  cin >> n >> s;
  sc = s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      ans2++;
    }
    if (s[i] == '.') {
      if (m == '#') {
        s[i] = '#';
        ans1++;
      }
    }
    m = s[i];
  }
  if (ans1 > ans2) {
    ans = ans2;
  } else {
    ans = ans1;
  }
  cout << ans << endl;
}
