#include <bits/stdc++.h>
using namespace std;
long long int i, n, m, x, y, z, j, k, l, mn = LLONG_MAX, mx = 0, c, a[200005],
                                         r, cnt = 0, sum = 0;
string str;
char ch;
set<long long int> second;
map<long long int, long long int> mp;
vector<vector<long long int>> g;
vector<long long int> v;
char grid[60][60];
long long int d[60][60];
bool vis[60][60];
long long int dx[] = {0, 1, 0, -1, 1, -1, -1, 1};
long long int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
bool valid(long long int x, long long int y) {
  return (x >= 0 && y >= 0 && y < m && x < n);
}
long long int gcd(long long int x, long long int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string str, n;
  long long int a[256] = {0}, b[256] = {0}, yay = 0, whoop = 0;
  cin >> str >> n;
  for (i = 0; i < str.size(); i++) a[str[i]]++;
  for (i = 0; i < n.size(); i++) b[n[i]]++;
  for (i = 0; i < 256; i++) {
    mn = min(a[i], b[i]);
    yay += mn;
    b[i] -= mn;
    a[i] -= mn;
  }
  for (i = 0; i < 256; i++) {
    if (a[i] > 0 && (b[i + 32] > 0 || b[i - 32] > 0)) {
      b[i + 32] > 0 ? k = b[i + 32] : k = b[i - 32];
      mn = min(a[i], k);
      whoop += mn;
    }
  }
  cout << yay << " " << whoop;
  return 0;
}
