#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, t;
  cin >> s >> t;
  vector<int> f[2], r[2];
  f[0].assign(26, 0);
  f[1].assign(26, 0);
  for (int i = 0; i < t.size(); ++i)
    if (islower(t[i]))
      ++f[0][t[i] - 'a'];
    else
      ++f[1][t[i] - 'A'];
  r[0].assign(26, 0);
  r[1].assign(26, 0);
  for (int i = 0; i < s.size(); ++i)
    if (islower(s[i]))
      ++r[0][s[i] - 'a'];
    else
      ++r[1][s[i] - 'A'];
  int yay, whoops;
  yay = whoops = 0;
  for (int i = 0; i < 2; ++i)
    for (int j = 0; j < 26; ++j) {
      if (r[i][j] <= f[i][j]) {
        yay += r[i][j];
        f[i][j] -= r[i][j];
        r[i][j] = 0;
      } else {
        yay += f[i][j];
        r[i][j] -= f[i][j];
        f[i][j] = 0;
      }
    }
  for (int i = 0; i < 26; ++i)
    whoops += min(f[0][i] + f[1][i], r[0][i] + r[1][i]);
  cout << yay << " " << whoops;
}
