#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n;
  string s;
  cin >> n >> s;
  int first = -1;
  int ans1 = 0, ans2 = 0;
  int last = n;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == '#') {
      last = i;
    } else if (s[i] == '.') {
      break;
    }
  }
  for (int i = 0; i < last; i++) {
    if (first == -1 && s[i] == '#') {
      first = i;
      ans2++;
    } else if (first != -1) {
      if (s[i] == '.') {
        ans1++;
      } else {
        ans2++;
      }
    }
  }
  if (first == -1) {
    cout << 0 << endl;
  } else {
    cout << min(ans1, ans2) << endl;
  }
  return 0;
}
