#include <bits/stdc++.h>
using namespace std;
template <class T>
void GETV(T &v) {
  for (int((i)) = (0); ((i)) < ((v.size())); ((i))++) {
    cin >> (v[i]);
  }
}
template <class T>
void SHOWV(T &v) {
  for (int((i)) = (0); ((i)) < ((v.size())); ((i))++) {
    cout << (v[i]) << endl;
  }
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int white = 0;
  int black = n;
  for (int i = 0; i < n; i++) {
    if (s[i] == '.') {
      white = i;
    } else {
      if (black > i) {
        black = i;
      }
    }
  }
  int cnt1 = 0;
  int cnt2 = 0;
  for (int i = 0; i <= white; i++) {
    if (s[i] == '#') {
      cnt1++;
    }
  }
  for (int i = n - 1; i >= black; i--) {
    if (s[i] == '.') {
      cnt2++;
    }
  }
  cout << (cnt1 > cnt2 ? cnt2 : cnt1) << endl;
  return 0;
}
