#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  scanf("%d", &n);
  cin >> s;
  int max1 = 0;
  int cnt = 0;
  bool isblack = false;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '#') {
      isblack = true;
    } else {
      if (isblack) {
        max1++;
      }
    }
  }
  cnt = 0;
  int max2 = 0;
  bool iswhite = false;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == '.') {
      iswhite = true;
    } else {
      if (iswhite) {
        max2++;
      }
    }
  }
  if (cnt > max2) max2 = cnt;
  cout << min(max1, max2) << endl;
}
