#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  int s[n];
  for (long long i = (0); i < (n); i++) {
    char input;
    cin >> input;
    if (input == '#') {
      s[i] = 1;
    } else {
      s[i] = 0;
    }
  }
  int max_n = n - 1;
  for (int i = n - 1; i > 0; i--) {
    if (s[i] == 0 || (s[i] == 1 && s[i - 1] == 0)) {
      max_n = i;
      break;
    }
  }
  int cnt_1 = 0;
  for (long long i = (0); i < (max_n); i++) {
    if (s[i] == 1 && s[i + 1] == 0) cnt_1++;
  }
  int cnt_2 = 0;
  for (int i = max_n; i > 0; i--) {
    if (s[i] == 0 && s[i - 1] == 1) cnt_2++;
  }
  cout << min(cnt_1, cnt_2) << endl;
  return 0;
}
