#include <bits/stdc++.h>
using namespace std;
long long a[300], b[300], o, p, q;
string s, t, k, l;
int main() {
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++) {
    a[int(s[i]) - 60]++;
  }
  for (int i = 0; i < t.size(); i++) {
    b[int(t[i]) - 60]++;
  }
  for (int i = 0; i <= 200; i++) {
    if (a[i] == 0) continue;
    if (a[i] <= b[i])
      o += a[i], b[i] -= a[i], a[i] = 0;
    else
      o += b[i], a[i] -= b[i], b[i] = 0;
  }
  for (int i = 5; i <= 30; i++) {
    if (a[i] == 0) continue;
    if (a[i] <= b[i + 32])
      q += a[i];
    else
      q += b[i + 32];
  }
  for (int i = 37; i <= 62; i++) {
    if (a[i] == 0) continue;
    if (a[i] <= b[i - 32])
      q += a[i];
    else
      q += b[i - 32];
  }
  cout << o << " " << q;
}
