#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0;
  int ANS = 0;
  int ANS2 = 0;
  char S1[200010];
  char S2[200010];
  cin >> N;
  cin >> S1;
  for (int i = 0; i < N; i++) {
    S2[i] = S1[i];
  }
  vector<int> DATA(N);
  for (int i = 0; i < N - 1; i++) {
    if (S1[i] == '#') {
      if (S1[i + 1] == '.') {
        S1[i + 1] = '#';
        ANS++;
      }
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    if (S2[i] == '.') {
      if (S2[i - 1] == '#') {
        S2[i - 1] = '.';
        ANS2++;
      }
    }
  }
  cout << ((ANS) < (ANS2) ? (ANS) : (ANS2)) << endl;
  return 0;
}
