#include <bits/stdc++.h>
const int SIZE = 110;
const int SIZE2 = 50010;
using namespace std;
int keys[255];
void reset();
int main() {
  string str;
  int roomSize;
  while (scanf("%d", &roomSize) == 1) {
    cin >> str;
    int cost = 0;
    int len = str.length();
    for (int i = 0; i < len; i += 2) {
      char key = str[i];
      char roomKey = str[i + 1];
      if (toupper(key) != roomKey) {
        keys[key]++;
        if (keys[tolower(roomKey)] == 0) {
          cost++;
        } else {
          keys[tolower(roomKey)]--;
        }
      }
    }
    printf("%d\n", cost);
    reset();
  }
  return 0;
}
void reset() {
  for (int i = 0; i < 255; i++) {
    keys[i] = 0;
  }
}
