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