#include <bits/stdc++.h>
template <class T>
T _diff(T a, T b) {
  return (a < b ? b - a : a - b);
}
template <class T>
T _abs(T a) {
  return (a < 0 ? -a : a);
}
template <class T>
T _max(T a, T b) {
  return (a > b ? a : b);
}
template <class T>
T _min(T a, T b) {
  return (a < b ? a : b);
}
template <class T>
T max3(T a, T b, T c) {
  return (_max(a, b) > c ? _max(a, b) : c);
}
template <class T>
T min3(T a, T b, T c) {
  return (_min(a, b) < c ? _min(a, b) : c);
}
template <class T>
T GCD(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  T tmp;
  while (a % b) {
    tmp = a % b;
    a = b;
    b = tmp;
  }
  return b;
}
template <class T>
T LCM(T a, T b) {
  a = _abs(a);
  b = _abs(b);
  return (a / GCD(a, b)) * b;
}
template <class T>
T toRad(T deg) {
  return (deg * 2.0 * acos(0.0)) / (180.0);
}
template <class T>
T toDeg(T rad) {
  return (rad * 180.0) / (2.0 * acos(0.0));
}
using namespace std;
int i, j, x, y, a[30], b[30], a1[30], b1[30];
string s, t;
int main() {
  cin >> s >> t;
  x = 0;
  y = 0;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  memset(a1, 0, sizeof(a1));
  memset(b1, 0, sizeof(b1));
  for (i = 0; i < t.size(); i++) {
    if (t[i] >= 'a' && t[i] <= 'z')
      a[t[i] - 'a']++;
    else
      b[t[i] - 'A']++;
  }
  for (i = 0; i < s.size(); i++) {
    if (s[i] >= 'a' && s[i] <= 'z')
      a1[s[i] - 'a']++;
    else
      b1[s[i] - 'A']++;
  }
  for (i = 0; i < 30; i++) {
    j = min(a1[i], a[i]);
    a[i] -= j;
    a1[i] -= j;
    x += j;
    j = min(b1[i], b[i]);
    b[i] -= j;
    b1[i] -= j;
    x += j;
    y += (min(a1[i], b[i]) + min(b1[i], a[i]));
  }
  cout << x << " " << y << endl;
  return 0;
}
