#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  vector<int> v(26, 0);
  int buy = 0;
  for (int i = 0; i < str.size(); i++) {
    if (i % 2 == 0) {
      v[str[i] - 'a']++;
    } else {
      int idx = str[i] - 'A';
      if (v[idx] > 0)
        v[idx]--;
      else {
        buy++;
      }
    }
  }
  cout << buy << endl;
  return 0;
}
