#include <bits/stdc++.h>
using namespace std;
int main() {
  unordered_map<char, int> check;
  int n, count = 0;
  cin >> n;
  string temp;
  cin >> temp;
  for (int i = 0; i < temp.size() - 1; i += 2) {
    check[temp[i]]++;
    char ch = temp[i + 1];
    ch = tolower(ch);
    if (check.find(ch) != check.end()) {
      if (check[ch] == 1)
        check.erase(ch);
      else
        check[ch]--;
    } else {
      count++;
    }
  }
  cout << count;
  return 0;
}
