#include <bits/stdc++.h>
using namespace std;
int s1[30], b1[30];
int s2[30], b2[30];
string a, b;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(s1, 0, sizeof(s1));
  memset(b1, 0, sizeof(b1));
  memset(s2, 0, sizeof(s2));
  memset(b2, 0, sizeof(b2));
  cin >> a;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] >= 'a' && a[i] <= 'z')
      s1[a[i] - 'a']++;
    else
      b1[a[i] - 'A']++;
  }
  cin >> a;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] >= 'a' && a[i] <= 'z')
      s2[a[i] - 'a']++;
    else
      b2[a[i] - 'A']++;
  }
  int ans1 = 0, ans2 = 0;
  {}
  for (int i = 0; i < 30; i++) {
    if (s1[i] > 0 && s2[i] > 0) {
      int p = min(s1[i], s2[i]);
      ans1 += p;
      s1[i] -= p;
      s2[i] -= p;
    }
    if (b1[i] > 0 && b2[i] > 0) {
      int p = min(b1[i], b2[i]);
      ans1 += p;
      b1[i] -= p;
      b2[i] -= p;
    }
  }
  for (int i = 0; i < 30; i++) {
    if (s1[i] > 0 && b2[i] > 0) {
      ans2 += min(s1[i], b2[i]);
    }
    if (s2[i] > 0 && b1[i] > 0) {
      ans2 += min(s2[i], b1[i]);
    }
  }
  cout << ans1 << " " << ans2;
  return 0;
}
