#include <bits/stdc++.h>
using namespace std;
int main() {
  long N;
  string S;
  cin >> N >> S;
  string T = S;
  int ans1 = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S[i] == '#' && S[i + 1] == '.') {
      S[i + 1] == '#';
      ans1++;
    }
  }
  int ans2 = 0;
  for (int i = 0; i < N - 1; i++) {
    if (T[i] == '#' && T[i + 1] == '.') {
      T[i] == '.';
      ans2++;
    }
  }
  cout << min(ans1, ans2) << endl;
}
