#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0;
  map<char, int> M;
  cin >> n;
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (i % 2 == 0)
      M[s[i]]++;
    else if (M[s[i] + ('a' - 'A')] > 0)
      M[s[i] + ('a' - 'A')]--;
    else
      o++;
  }
  cout << o;
  return 0;
}
