#include <bits/stdc++.h>
using namespace std;
char cap(char x) { return x + 32; }
int32_t main() {
  long long n;
  cin >> n;
  string s;
  cin >> s;
  map<char, long long> mp;
  long long count = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (i % 2 == 0)
      mp[s[i]]++;
    else {
      char ch = cap(s[i]);
      if (mp[ch] != 0)
        mp[ch]--;
      else
        count++;
    }
  }
  cout << count << endl;
}
