#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m = 0, i, sum, p = 0, q, k;
  string s;
  while (cin >> n >> s) {
    p = m = q = 0;
    for (i = 0; i < n; i++) {
      if (s[i] == '#') {
        q++;
        p = 1;
        k = 0;
      }
      if (s[i] == '.' && p == 1 && k == 0) {
        m++;
        k = 1;
      }
    }
    sum = min(m, q);
    cout << sum << endl;
  }
  return 0;
}
