#include <bits/stdc++.h>
using namespace std;
const int maxn = 200;
string s, t;
int a[maxn], b[maxn];
int num(char c) {
  if ('a' <= c && c <= 'z')
    return c - 'a';
  else
    return c - 'A' + 26;
}
int main() {
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++) a[num(s[i])]++;
  for (int i = 0; i < t.size(); i++) b[num(t[i])]++;
  int yay = 0, whoops = 0;
  for (int i = 0; i < maxn; i++) {
    int tmp = min(a[i], b[i]);
    yay += tmp;
    a[i] -= tmp;
    b[i] -= tmp;
  }
  for (int i = 0; i < 26; i++) {
    int tmp = min(a[i], b[i + 26]);
    whoops += tmp;
    a[i] -= tmp;
    b[i + 26] -= tmp;
    tmp = min(a[i + 26], b[i]);
    whoops += tmp;
    a[i + 26] -= tmp;
    b[i] -= tmp;
  }
  cout << yay << " " << whoops << endl;
}
