#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  cin >> s >> t;
  map<char, int> cnt;
  for (int i = 0; i < s.size(); i++) {
    cnt[s[i]]++;
  }
  vector<bool> found(t.size(), false);
  int c = 0;
  for (int i = 0; i < t.size(); i++) {
    if (cnt[t[i]] > 0) {
      cnt[t[i]]--;
      c++;
      found[i] = true;
    }
  }
  int d = 0;
  for (int i = 0; i < t.size(); i++) {
    if (!found[i]) {
      if (t[i] >= 'a' and t[i] <= 'z') {
        char x = t[i] - 'a' + 'A';
        if (cnt[x] > 0) {
          d++;
          cnt[x]--;
        }
      } else if (t[i] >= 'A' and t[i] <= 'Z') {
        char x = t[i] - 'A' + 'a';
        if (cnt[x] > 0) {
          d++;
          cnt[x]--;
        }
      }
    }
  }
  cout << c << " " << d << endl;
}
