#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S1;
  string S2;
  int f = 0;
  int ANS1 = 0;
  int ANS2 = 0;
  cin >> N;
  cin >> S1;
  S2 = S1;
  for (int i = 0; i < N; i++) {
    if (S1[i] == '#' && S1[i + 1] == '.') {
      S1[i + 1] = '#';
      ANS1++;
    }
  }
  for (int i = 0; i < N; i++) {
    if (S2[i] == '#' && i != N - 1) {
      ANS2++;
    }
  }
  cout << min(ANS1, ANS2) << endl;
}
