#include <bits/stdc++.h>
using namespace std;
const int INF = 1009;
int a[INF], b[INF];
string s;
int main() {
  cin >> s;
  for (int i = 0; i < s.size(); i++) a[s[i] - 'A']++;
  cin >> s;
  for (int i = 0; i < s.size(); i++) b[s[i] - 'A']++;
  int k = 0, m = 0;
  for (int i = 0; i < 100; i++) {
    if (a[i] > 0) {
      k += min(a[i], b[i]);
      if (a[i] > b[i])
        a[i] -= b[i], b[i] = 0;
      else
        b[i] -= a[i], a[i] = 0;
    }
  }
  for (int i = 0; i < 100; i++) {
    if (i < 32 && a[i] > 0 && b[i + 32] > 0) m += min(a[i], b[i + 32]);
    if (i >= 32 && a[i] > 0 && b[i - 32] > 0) m += min(a[i], b[i - 32]);
  }
  cout << k << ' ' << m << endl;
}
