#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int>& p1, const pair<int, int>& p2) {
  return p1.first < p2.first;
}
int mark[100];
int main() {
  int n;
  scanf("%d", &n);
  string a;
  cin >> a;
  int l = a.size();
  int ans = 0;
  for (int i = 0; i < l; i++) {
    if (i & 1) {
      if (mark[a[i] - 'A'] == 0)
        ans++;
      else {
        mark[a[i] - 'A'] -= 1;
        if (mark[a[i] - 'A'] < 0) mark[a[i] - 'A'] = 0;
      }
    } else
      mark[a[i] - 'a'] += 1;
  }
  printf("%d\n", ans);
}
