#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n, i, j, k, l;
  cin >> n;
  cin >> s;
  j = -1;
  k = 0;
  l = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (j == -1) j = 0;
      k++;
    } else {
      if (j != -1) j++;
      if (k != 0) {
        l += k;
        k = 0;
      }
    }
  }
  cout << min(l, max(j, 0));
  return 0;
}
