#include <bits/stdc++.h>
using namespace std;
template <typename X>
inline bool minimize(X& p, X q) {
  if (p <= q) return 0;
  p = q;
  return 1;
}
template <typename X>
inline bool maximize(X& p, X q) {
  if (p >= q) return 0;
  p = q;
  return 1;
}
int cc[30];
char s[200006];
int n;
void doit() {
  scanf("%s", s);
  int len = strlen(s);
  int f = 1, ans = 0, c;
  memset(cc, 0, sizeof(cc));
  for (int i = 0; i <= len - 1; i++) {
    c = (s[i] >= 'a' ? s[i] - 'a' : s[i] - 'A');
    if (f) cc[c]++;
    if (!f) {
      if (cc[c])
        cc[c]--;
      else
        ans++;
    }
    f ^= 1;
  }
  printf("%d\n", ans);
}
int main() {
  while (scanf("%d", &n) != EOF) doit();
}
