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