#include <bits/stdc++.h>
using namespace std;
int main() {
  size_t n = 0;
  cin >> n;
  string str = "";
  cin >> str;
  vector<int> key(26, 0);
  int res = 0;
  for (size_t i = 0; i < str.size(); i++) {
    if ((i + 1) % 2 != 0)
      key[str[i] - 97]++;
    else {
      if (key[str[i] - 65] <= 0)
        res++;
      else
        key[str[i] - 65]--;
    }
  }
  cout << res;
  return 0;
}
