#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  char S[200010];
  char S_copy[200010];
  cin >> N;
  cin >> S;
  copy(S, S + N, S_copy);
  char black = '#';
  char white = '.';
  int res1 = 0;
  for (int i = 0; i < N - 1; i++) {
    if (S_copy[i] == black && S_copy[i + 1] == white) {
      res1++;
    }
  }
  int res2 = 0;
  for (int i = 1; i < N; i++) {
    if (S[i] == white && S[i - 1] == black) {
      S[i] = black;
      res2++;
    }
  }
  int res = res1;
  if (res1 > res2) res = res2;
  cout << res << "\n";
}
