#include <bits/stdc++.h>
using namespace std;
int a[500], b[500];
string s, t;
int ans, ans2;
int main() {
  cin >> s >> t;
  for (int i = 0; i < s.size(); i++) a[s[i]]++;
  for (int i = 0; i < t.size(); i++) b[t[i]]++;
  for (int i = 0; i < 500; i++) {
    int tmp = min(a[i], b[i]);
    ans += tmp;
    a[i] -= tmp;
    b[i] -= tmp;
  }
  for (int i = 'a'; i <= 'z'; i++)
    ans2 += min(a[i], b[i + 'A' - 'a']) + min(a[i + 'A' - 'a'], b[i]);
  cout << ans << " " << ans2 << endl;
}
