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