#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
string second, t;
vector<int> a(52, 0), b(52, 0);
int main() {
  getline(cin, second);
  getline(cin, t);
  for (int i = 0; i < (int)second.size(); i++) {
    if (second[i] >= 'a')
      a[second[i] - 'a']++;
    else
      a[26 + second[i] - 'A']++;
  }
  for (int i = 0; i < (int)t.size(); i++) {
    if (t[i] >= 'a')
      b[t[i] - 'a']++;
    else
      b[26 + t[i] - 'A']++;
  }
  int k1 = 0, k2 = 0;
  for (int i = 0; i < 52; i++) {
    int mn = min(a[i], b[i]);
    k1 += mn;
    a[i] -= mn;
    b[i] -= mn;
  }
  for (int i = 26; i < 52; i++) {
    a[i - 26] += a[i];
    b[i - 26] += b[i];
  }
  for (int i = 0; i < 26; i++) {
    k2 += min(a[i], b[i]);
  }
  cout << k1 << " " << k2 << endl;
  return 0;
}
