#include <bits/stdc++.h>
using namespace std;
int scnt[256], tcnt[256];
void read(int *cnt) {
  string s;
  cin >> s;
  for (char c : s) {
    cnt[c]++;
  }
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  ios::sync_with_stdio(false);
  read(scnt);
  read(tcnt);
  int yay = 0, whoops = 0;
  for (int i = 0; i < 26; i++) {
    char c = i + 'a';
    int m = min(scnt[c], tcnt[c]);
    yay += m;
    scnt[c] -= m;
    tcnt[c] -= m;
    char d = i + 'A';
    m = min(scnt[d], tcnt[d]);
    yay += m;
    scnt[d] -= m;
    tcnt[d] -= m;
    int srem = scnt[c] + scnt[d];
    int trem = tcnt[c] + tcnt[d];
    whoops += min(srem, trem);
  }
  cout << yay << ' ' << whoops << endl;
}
