#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  char s[n];
  cin >> s;
  int find = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      find = 1;
    }
    if (find == 1 && s[i] == '.') {
      find = 2;
      break;
    }
  }
  if (find == 2) {
    find = 0;
    int nchw = 0;
    int nchb = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == '#') {
        find = 1;
      }
      if (find == 1 && s[i] == '#') nchw++;
      if (find == 1 && s[i] == '.') nchb++;
    }
    if (nchw < nchb)
      cout << nchw << "\n";
    else
      cout << nchb << "\n";
  } else
    cout << "0\n";
  return 0;
}
