#include <bits/stdc++.h>
using namespace std;
class Vitaliy_and_Pie {
 public:
  void solve(std::istream& in, std::ostream& out) {
    int n, i, j;
    in >> n;
    string s;
    in >> s;
    int l = s.size();
    int c = 0;
    map<char, int> m;
    for (i = 0; i < l; i++) {
      m[s[i]]++;
      if (i % 2 != 0) {
        char ch = tolower(s[i]);
        auto f = m.find(ch);
        if (f != m.end() && m[ch] > 0)
          m[ch]--;
        else
          c++;
      }
    }
    out << c << endl;
  }
};
int main() {
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(nullptr);
  Vitaliy_and_Pie solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}
