#include <bits/stdc++.h>
using namespace std;
string s;
int n;
int amt[26];
int ans;
int main() {
  cin >> n;
  cin >> s;
  ans = 0;
  for (long long(i) = (0); (i) < (((int)s.size())); (i)++) {
    amt[s[i] - 'a']++;
    i++;
    if (amt[s[i] - 'A'])
      amt[s[i] - 'A']--;
    else
      ans++;
  }
  cout << ans << endl;
}
