#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  ll n;
  cin >> n;
  string s;
  cin >> s;
  ll black = 0;
  for (long long i = 0; i < (long long)(n - 1); i++) {
    if (s[i] == '#' && s[i + 1] == '.') black++;
  }
  cout << min(n - black, black) << endl;
}
