#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int tmp1 = 0, tmp2 = 0, tmp3 = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '.')
      tmp1++;
    else
      tmp2++;
  }
  int ind = n;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '.') {
      ind = i;
      break;
    }
  }
  if (ind != n) {
    for (int i = 0; i < (ind); ++i) {
      if (s[i] == '#') tmp3++;
    }
  }
  cout << min({tmp1, tmp2, tmp3}) << endl;
}
