#include <bits/stdc++.h>
using namespace std;
int a[26] = {0};
int main() {
  int res = 0, n;
  cin >> n;
  string s;
  cin >> s;
  n = s.length();
  for (int i = 0; i < n; i++) {
    char x = s[i];
    ++a[x - 97];
    i++;
    char y = s[i];
    if (a[y - 65] > 0)
      a[y - 65]--;
    else {
      res++;
    }
  }
  cout << res;
  return 0;
}
