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