#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int flag = 0, b = 0, w = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '#') {
      if (flag) {
        b++;
      } else
        flag = 1;
    } else if (flag == 1 && s[i] == '.') {
      w++;
    }
  }
  int ans = b < w ? b : w;
  cout << ans << endl;
}
