#include <bits/stdc++.h>
using namespace std;
int arr['z' * 2];
int main() {
  cout.sync_with_stdio(false);
  int x;
  cin >> x;
  string r;
  cin >> r;
  int c = 0;
  for (int i = 0; i < r.length(); i += 2) {
    arr[r[i]]++;
    if (arr[tolower(r[i + 1])] == 0) {
      c++;
    } else {
      arr[tolower(r[i + 1])]--;
    }
  }
  cout << c;
}
