#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int N;
int solve(string S, string T) {
  int res = 0;
  for (int i = 0; i < (N - 1); ++i) {
    if (S[i] == T[0] && S[i + 1] == T[1]) {
      S[i + 1] = T[0];
      ++res;
    }
  }
  return res;
}
int main() {
  cin >> N;
  string S;
  cin >> S;
  string rS = S;
  reverse(rS.begin(), rS.end());
  cout << min(solve(S, "#."), solve(rS, ".#")) << endl;
}
