#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  string s, s1, s2;
  cin >> s;
  transform(s.begin(), s.end(), s.begin(), ::toupper);
  for (int i = 0; i < s.size(); i += 2) {
    s1 += s[i];
    char c = s[i + 1];
    size_t found = s1.find(c);
    if (found != string::npos) {
      s1.erase(s1.begin() + found);
    } else {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
