#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, cnt[250] = {0}, ans = 0;
  cin >> n;
  string a;
  cin >> a;
  for (int i = 0; i < a.size(); i++) {
    if (i % 2 == 0)
      cnt[a[i]]++;
    else {
      if (cnt[a[i] + 32])
        cnt[a[i] + 32]--;
      else
        ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
