#include <bits/stdc++.h>
using namespace std;
int v[26];
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count = 0;
  for (int i = 0; i < s.size(); ++i) {
    if (i % 2 == 0) {
      if (v[s[i] - 'a'] > 0) {
        count += v[s[i] - 'a'];
        v[s[i] - 'a'] = -1;
      } else
        v[s[i] - 'a']--;
    } else {
      v[s[i] - 'A']++;
    }
  }
  for (int i = 0; i < 26; ++i)
    if (v[i] > 0) count += v[i];
  cout << count;
  return 0;
}
