#include <bits/stdc++.h>
int dataA[26];
int main() {
  int n, j = 0, count = 0;
  char ch;
  scanf("%d%c", &n, &ch);
  for (int i = 1; i <= 2 * n - 2; ++i) {
    scanf("%c", &ch);
    if (!j)
      ++dataA[ch - 'a'];
    else {
      if (dataA[ch - 'A'] == 0)
        ++count;
      else
        --dataA[ch - 'A'];
    }
    j ^= 1;
  }
  printf("%d\n", count);
  return 0;
}
