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