#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  vector<pair<char, int>> a;
  a.emplace_back(make_pair(s[0], 1));
  for (int i = 1; i < s.length(); i++) {
    if (s[i] != s[i - 1]) {
      a.emplace_back(make_pair(s[i], 1));
    } else {
      a[a.size() - 1].second++;
    }
  }
  if (a[0].first == '.') {
    n -= a[0].second;
    a[0].second = 0;
  }
  if (a[a.size() - 1].first == '#') {
    n -= a[a.size() - 1].second;
    a[a.size() - 1].second = 0;
  }
  int ans = 0;
  for (int i = 0; i < a.size(); i++) {
    ans += a[i].first == '.' ? a[i].second : 0;
  }
  cout << min(ans, n - ans) << endl;
  return 0;
}
