#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  unordered_map<char, int> um;
  int cnt = 0;
  for (int i = 0; i < s.length(); i++) {
    if (i % 2 == 0) {
      um[s[i]]++;
    } else if (i % 2 != 0) {
      if (um[s[i] + 32] == 0) {
        cnt++;
      } else {
        um[s[i] + 32]--;
      }
    }
  }
  cout << cnt;
}
