#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c;
  string str;
  int val[256];
  cin >> n;
  cin >> str;
  int ct = 0;
  int l = str.length();
  memset(&val, 0, sizeof(val));
  for (int i = 0; i < l; i++) {
    if (i % 2 == 0) {
      val[str[i]]++;
    } else {
      c = (int)str[i] + 32;
      if (val[c] > 0)
        val[c]--;
      else
        ct++;
    }
  }
  cout << ct << endl;
}
